How can I send a beep to the console when someone logs in.
I use bash and perl
I use bash and perl
if [ "$LOGNAME" != "root" ]
then
echo -e '\007' >/dev/tty0
fi
If your console is the device console, check this out by doing a tty on
the console then replace the tty0 with what ever the tty command echo's
back.
Dave.T.
-**** Posted from remarQ, Discussions Start Here(tm) ****-
http://www.remarq.com/ - Host to the the World's Discussions & Usenet
my hands were going faster than my brain the echo command
should read...
echo -e '\007' ......
thats a single quote not a double quote.
doh !
Dave.T.
-**** Posted from remarQ, Discussions Start Here(tm) ****-
http://www.remarq.com/ - Host to the the World's Discussions & Usenet
|> > How can I send a beep to the console when someone logs in.
|> >
|> > I use bash and perl
|> >
|> >
|>
|> In the .login/.profile (don't recall which bash uses) add this:
|>
|> echo "\a" > /dev/console
Nope. This will just print 'a' on the console.
$ echo -ne "\a" >/dev/console
--
Andreas Schwab "And now for something
>> |> > How can I send a beep to the console when someone logs in.
>> |> >
>> |> > I use bash and perl
>> |> >
>> |> >
>> |>
>> |> In the .login/.profile (don't recall which bash uses) add this:
This is a notoriously variable area. Don't assume that /usr/bin/echo,Quote:>> |>
>> |> echo "\a" > /dev/console
>Hmmm.... the echo "\a" worked, as did echo "\a">filename, with a cat of the
>file name ringing the bell. Granted I did not test doing this to the console
>(as I have a small aversion to playing with virtual fire).
>> Nope. This will just print 'a' on the console.
>> $ echo -ne "\a" >/dev/console
>I'm on a DEC^h^h^hCompaq 8400, and there is no "e" option. What does this do?
However, the original question concerned bash, so
echo -ne "\a"
is right: the -e enables escape expansion and the -n supresses the linefeed.
Chris Thompson
Email: cet1 [at] cam.ac.uk
1. Send beep to console when someone logs in via telnet
I can send a beep to the console when someone logs in at my computer but it
doesn't work when someone logs in via telnet. I thought the profile was
global. What file is used to display the login for telnet? I thought it was
issue.net.
I use bash with RH5.x
3. Need HELP to Log User Log-ins form the internet
5. How to check if someone is logged on from the console?
6. Help ! Failed boot disk ? Short read 0x2000 chars read
8. Can Tru64 unix support SCHED_FIFO and SCHED_OTHER simultaneously?
9. Q. How do I view messages sent to /dev/console when logged into X?
10. pppd dial ins and , "LCP: timeout sending Config-Requests"
11. sending system beep to sound card ?
12. MISalert - self-diagnosing computers send alphanumeric beeps to MIS staff
13. System logging going to console not log file