LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-12-2005, 12:45 PM   #1
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Rep: Reputation: 30
bash beep


Using bash, from the command line, if i enter this command:
>beep
I get a beep

If create a .sh file with a line that has 'beep', it doesn't work, i get this:
./beep.sh: line 1: beep: command not found

Why?
How do I make it beep?
 
Old 05-12-2005, 01:08 PM   #2
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 53
In a terminal, try:
which beep
or
whereis beep
and then use that full path in your script
 
Old 05-12-2005, 01:32 PM   #3
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Original Poster
Rep: Reputation: 30
# which beep
# whereis beep
beep:


So:
which beep returns nothing.
whereis beep gives no path.
Now what?
 
Old 05-12-2005, 03:06 PM   #4
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Rep: Reputation: 30
Hello,

How about this:
Code:
slocate -u
and then

Code:
slocate beep
One hangup, if you've never used slocate before you have to create the dB, before you can update it.
I just read manpages and can't find the command to create the dB, so maybe the -u option does do the trick.

GL,
-Jason
 
Old 05-12-2005, 03:55 PM   #5
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,178

Rep: Reputation: 49
iirc, updatedb is the command used prior to slocate
 
Old 05-12-2005, 04:03 PM   #6
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Original Poster
Rep: Reputation: 30
I had tried locate (not slocate), but it found only audio files.
I don't have slocate, but i don't think it would find anything different, since i did the locate as root.
(yes i first did a updatedb)
 
Old 05-12-2005, 04:24 PM   #7
username17
Member
 
Registered: Aug 2004
Location: Norfolk VA
Distribution: Slackware 11
Posts: 230

Rep: Reputation: 30
Hello,

Thanks, updatedb sounded familiar, I just couldn't remember.

I have slackware, that's why I have slocate, locate should work the same.

Not sure about finding beep though.
Try each path in your $PATH for beep, you might be able to find it that way.
-Jason
 
Old 05-12-2005, 05:43 PM   #8
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 53
Strange that you can run it by typing beep but not find it by using which or whereis. I don't even have beep on my computer so I can't see what it is.
 
Old 05-25-2005, 04:39 PM   #9
allelopath
Member
 
Registered: Jan 2003
Location: New Mexico
Distribution: SuSE 9.2 Professional, OpenSuSE 10.1 64 bit, Open SuSE 10.2, Debian Etch
Posts: 535

Original Poster
Rep: Reputation: 30
clear

I'm having a similar problem with "clear".
The command works on the command line, but not in a script.
"which clear" finds it in /usr/bin/clear
if i put /usr/bin/clear in the script, it doesn't like that either.
 
Old 05-26-2005, 02:50 AM   #10
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 46
They aren't programs, that's why you can't find them. To make "clear" work in a file, you have to use:

clear > file.txt

I suspect "beep" is much the same - not sure, tho, as I hate beeping computers.

If you then do a "cat file.txt" it'll clear the screen/beep. If you open it in a text editor, you'll see the escape characters that signal the clear/beep.
 
Old 05-26-2005, 04:08 AM   #11
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
Code:
xxx@xxx:~> type beep
beep is aliased to `echo -en "\007"'
For me, beep is an alias, set to echo the 'beep character'. This alias is defined in /etc/bash.bashrc, which is not read by shell scripts. Hence you cannot use it there.

Groetjes,

Kees-Jan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beep off! X11 Linux - General 9 07-17-2008 11:08 AM
That annoying beep zchoyt Linux - Newbie 6 01-05-2007 08:38 PM
looking for a beep lungsucker Programming 3 07-11-2005 08:01 AM
Beep Beep! Linux~Powered Linux - Hardware 3 05-18-2004 06:28 AM
Beep pixelV Slackware 10 01-04-2003 02:19 PM


All times are GMT -5. The time now is 03:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration