LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-31-2003, 11:03 PM   #1
darin3200
LQ Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Rep: Reputation: 45
Getting "event not found" when making scripts


I'm trying to write shell scripts but everytime I try I get and error saying "!/bin/bash: event not found" I've tried typing
!/bin/bash
#!/bin/bash
and the same thing with sh instead of bash and I always get the same errors. Am I missing something? I have install bash and I see it as an program. Thanks
 
Old 09-01-2003, 12:34 AM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
This happens when you create _any_ script?
 
Old 09-01-2003, 12:45 AM   #3
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 59
output this:
ls -alc /bin/bash*
 
Old 09-01-2003, 09:17 AM   #4
darin3200
LQ Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Original Poster
Rep: Reputation: 45
Well how do you right a script? I open a terminal and type "!/bin/bash" and I get "event not found" same with when I just type "#!/bin/bash" The mandrake howto I have has
#!/bin/bash
echo Hello World
I can't get to the Hello World part because when I hit enter I get event not found.
-rwxr-xr-x 1 root root 625516 Aug 31 11:16 /bin/bash*
lrwxrwxrwx 1 root root 4 Aug 31 11:16 /bin/bash2 -> bash*
 
Old 09-01-2003, 12:01 PM   #5
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Shell scripts are contained in text files... You don't type them on the command-line directly. Open a text editor and go to town...

The first time you try to run the script, save it, and at a command-line type:
chmod u+x filename

That will make the file executable. Then type:
./filename

That will run the script. The ./ at the beginning is to make sure the script in the current directory is run.

The "#!/bin/bash" line should be the first line in your script, and it tells the system that you want bash to interpret the commands in the file.
 
Old 09-01-2003, 12:37 PM   #6
darin3200
LQ Guru
 
Registered: Dec 2002
Distribution: Gentoo!
Posts: 1,153

Original Poster
Rep: Reputation: 45
That works, I wasn't quite understanding how to do that but it makes sense now
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Successful install" results in "Boot device not found" slackr007 Fedora 2 06-21-2005 05:05 PM
"Successful install" results in "Boot device not found" slackr007 Linux - Newbie 2 05-31-2005 09:02 PM
.kde/Autostart bash scripts "file not found" Nice-n-Slow Linux - Software 1 07-02-2004 06:25 PM
Couldn't display "SMB:///" , No host "(Null)" could been Found?????? help munkey Fedora 6 04-30-2004 07:04 PM
Why do scripts like "./install" and "./configure" not work for me? engineerwell Linux - Newbie 2 02-05-2004 08:09 AM


All times are GMT -5. The time now is 04:52 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration