Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Input of char 's' is not possible anymore Post 302379156 by daWonderer on Wednesday 9th of December 2009 05:22:38 PM
Old 12-09-2009
Thanks for your answer and the interesting usage of commands.

But I have found the problem.

I have inserted a line to 'inputrc' for setting the beep length to 0.

Code:
setterm -blength 0

After deleting this line the usage of the 's' is again available.

Hmmm... Typing this command in shell sets the beep length to zero.
I don't know why it didn't work in 'inputrc'. Any hints?
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can't login as SU anymore - SU: NO SHELL

the root shell has been changed in the file /etc/passwd, basically pointing to an incorrect directory. So now every time we login as 'su' I get the message 'su: no shell' so we can't login as superuser. Is there an easy way to rectify this? please use step by step instructions/commands - I... (4 Replies)
Discussion started by: homechoice
4 Replies

2. Shell Programming and Scripting

How to replace any char with newline char.

Hi, How to replace any character in a file with a newline character using sed .. Ex: To replace ',' with newline Input: abcd,efgh,ijkl,mnop Output: abcd efgh ijkl mnop Thnx in advance. Regards, Sasidhar (5 Replies)
Discussion started by: mightysam
5 Replies

3. Programming

Adding a single char to a char pointer.

Hello, I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it: char* getext(char *file) { char *extension; int i, j;... (5 Replies)
Discussion started by: pallak7
5 Replies

4. Programming

concat const char * with char *

hello everybody! i have aproblem! i dont know how to concatenate const char* with char const char *buffer; char *b; sprintf(b,"result.txt"); strcat(buffer,b); thanx in advance (4 Replies)
Discussion started by: nicos
4 Replies

5. UNIX for Dummies Questions & Answers

Can't SSH as root anymore!

I've screwed something up in my sshd_config apparently, because I can't ssh with root anymore. I had disabled root login for security reasons, but then my ssh credentials with full administrative privelges stopped working. So then I reenabled root login (and reset ssh), but root now isn't... (3 Replies)
Discussion started by: cquarry
3 Replies

6. Programming

error: invalid conversion from ‘const char*’ to ‘char*’

Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially): xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’: xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’ The same error with all c++ constructors - gcc 4.4.4. If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies

7. Programming

I don't know how to replace input char with appropriate integer

Hi guys, I asked for help on programming forums and no one didn't helped me so I ask for help here. I am playing with some tasks from my book and I can't figure where did I get wrong. From the first program I get a blank screen, program won't generate 10*10 matrix. And second problem is I... (6 Replies)
Discussion started by: solaris_user
6 Replies

8. Slackware

Anyone Using Slackware Anymore?

We used to use Slackware, but then moved all our servers to Ubuntu Linux. Does anyone use Slackware anymore? (8 Replies)
Discussion started by: Neo
8 Replies

9. Programming

Invalid conversion from char* to char

Pointers are seeming to get the best of me and I get that error in my program. Here is the code #include <stdio.h> #include <stdlib.h> #include <string.h> #define REPORTHEADING1 " Employee Pay Hours Gross Tax Net\n" #define REPORTHEADING2 " Name ... (1 Reply)
Discussion started by: Plum
1 Replies
BEEP(1) 						      General Commands Manual							   BEEP(1)

NAME
beep - beep the pc speaker any number of ways SYNOPSIS
beep [--verbose | --debug] [-e device | --device device] [-f N] [-l N] [-r N] [-d N] [-D N] [-s] [-c] beep [ OPTIONS ] [-n] [--new] [ OPTIONS ] beep [-h] [--help] beep [-v] [-V] [--version] DESCRIPTION
beep allows the user to control the pc-speaker with precision, allowing different sounds to indicate different events. While it can be run quite happily on the command line, it's intended place of residence is within shell/perl scripts, notifying the user when something inter- esting occurs. Of course, it has no notion of what's interesting, but it's real good at that notifying part. All options have default values, meaning that just typing 'beep' will work. If an option is specified more than once on the command line, subsequent options override their predecessors. So 'beep -f 200 -f 300' will beep at 300Hz. OPTIONS
--verbose, --debug enable debug output. This option prints a line like the following before each beep: [DEBUG] 5 times 200 ms beeps (100 delay between, 0 delay after) @ 1000.00 Hz -e device, --device device use device as event device. If the switch isn't used, /dev/tty0 and /dev/vc/0 are tried in turn. -f N beep at N Hz, where 0 < N < 20000. As a general ballpark, the regular terminal beep is around 750Hz. N is not, incidentally, restricted to whole numbers. -l N beep for N milliseconds. -r N specify the number of repetitions (defaults to 1). -d N, -D N specify a delay of N milliseconds between repetitions. Use of -d specifies that this delay should only occur between beeps, that is, it should not occur after the last repetition. -D indicates that the delay should occur after every repetition, including the last. Normally, -d is what you want, but if, for example, you are stringing several beep commands together to play the star wars anthem, you may want control over every delay. -n, --new this option allows you to break the command line up into specifying multiple beeps. Each time this option is used, beep starts treating all further arguments as though they were for a new beep. So for example: beep -f 1000 -n -f 2000 -n -f 1500 would produce a sequence of three beeps, the first with a frequency of 1000Hz (and otherwise default values), then a second beep with a frequency of 2000Hz (again, with things like delay and reps being set to their defaults), then a third beep, at 1500Hz. This is different from specifying a -r value, since -r repeats the same beep multiple times, whereas -n allows you to specify different beeps. After a -n, the new beep is created with all the default values, and any of these can be specified without altering values for preceding (or later) beeps. See the EXAMPLES section if this managed to confuse you. -s, -c these options put beep into input-processing mode. -s tells beep to read from stdin, and beep after each newline, and -c tells it to do so after every character. In both cases, the program will also echo the input back out to stdout, which makes it easy to slip beep into a text-processing pipeline, see the EXAMPLES section. -h, --help display usage info and exit -v, -V, --version display version information and exit EXAMPLES
At its simplest (yet still effective) beep A more interesting standalone setup beep -f 300.7 -r 2 -d 100 -l 400 As part of a log-watching pipeline tail -f /var/log/xferlog | grep --line-buffered passwd | beep -f 1000 -r 5 -s When using -c mode, I recommend using a short -D, and a shorter -l, so that the beeps don't blur together. Something like this will get you a cheesy 1970's style beep-as-you-type-each-letter effect cat file | beep -c -f 400 -D 50 -l 10 A highly contrived example of -n/--new usage beep -f 1000 -r 2 -n -r 5 -l 10 --new will produce first two 1000Hz beeps, then 5 beeps at the default tone, but only 10ms long each, followed by a third beep using all the default settings (since none are specified). IOCTL WACKINESS
Some users will encounter a situation where beep dies with a complaint from ioctl(). The reason for this, as Peter Tirsek was nice enough to point out to me, stems from how the kernel handles beep's attempt to poke at (for non-programmers: ioctl is a sort of catch-all function that lets you poke at things that have no other predefined poking-at mechanism) the tty, which is how it beeps. The short story is, the kernel checks that either: - you are the superuser - you own the current tty What this means is that root can always make beep work (to the best of my knowledge!), and that any local user can make beep work, BUT a non-root remote user cannot use beep in it's natural state. What's worse, an xterm, or other x-session counts, as far as the kernel is concerned, as 'remote', so beep won't work from a non-privileged xterm either. I had originally chalked this up to a bug, but there's actually nothing I can do about it, and it really is a Good Thing that the kernel does things this way. There is also a solution. By default beep is not installed with the suid bit set, because that would just be zany. On the other hand, if you do make it suid root, all your problems with beep bailing on ioctl calls will magically vanish, which is pleasant, and the only reason not to is that any suid program is a potential security hole. Conveniently, beep is very short, so auditing it is pretty straightforward. Decide for yourself, of course, but it looks safe to me - there's only one buffer and fgets doesn't let it overflow, there's only one file opening, and while there is a potential race condition there, it's with /dev/console. If someone can exploit this race by replacing /dev/console, you've got bigger problems. :) So the quick, only, and likely safe solution if beep is not beeping when you want it to is (as root): # chmod 4755 /usr/bin/beep (or wherever you put it) The one snag is that this will give any little nitwit the ability to run beep successfully - make sure this is what you want. If it isn't, a slightly more complex fix would be something like: # chgrp beep /usr/bin/beep # chmod 4750 /usr/bin/beep and then add only beep-worthy users to the 'beep' group. FREQUENCY TABLE
Several people have asked for some basic help translating music notes to frequencies. There are a lot of music notes, and several tables online will give you translations, but here are approximate numbers for the octave of middle C, to get you started. Note Frequency C 261.6 C# 277.2 D 293.7 D# 311.1 E 329.6 F 349.2 F# 370.0 G 392.0 G# 415.3 A 440.0 A# 466.2 B 493.9 C 523.2 BUGS
None that I'm aware of, though see the IOCTL WACKINESS section. REPORTING BUGS
Report bugs to <johnath@johnath.com> AUTHOR
This program was written by Johnathan Nightingale (johnath@johnath.com) and is distributed under the GNU General Public License. For more contributing information, check the source, and past contributors can be found in CREDITS. July 2008 BEEP(1)
All times are GMT -4. The time now is 01:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy