LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-13-2003, 11:42 PM   #1
vapor
Member
 
Registered: Jul 2003
Distribution: SuSe
Posts: 38

Rep: Reputation: 15
execute bash scripts


whats the command to execute bash scripts u write
 
Old 07-13-2003, 11:48 PM   #2
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
./scriptname

first you need to set it's permissions to executable

chmod +x scriptname


david@slacker:~/test$ ls -l
total 4
-rw-r--r-- 1 david users 11 Jul 13 23:45 test
david@slacker:~/test$ chmod +x test
david@slacker:~/test$ ls -l
total 4
-rwxr-xr-x 1 david users 11 Jul 13 23:45 test*


or set only for owner and group

david@slacker:~/test$ chmod 750 test
david@slacker:~/test$ ls -l test
-rwxr-x--- 1 david users 11 Jul 13 23:45 test*

or owner only

david@slacker:~/test$ chmod 700 test
david@slacker:~/test$ ls -l test
-rwx------ 1 david users 11 Jul 13 23:45 test*



./test

Last edited by DavidPhillips; 07-13-2003 at 11:52 PM.
 
Old 07-13-2003, 11:48 PM   #3
angelrod
Member
 
Registered: Oct 2002
Location: Mexico
Distribution: RedHat 9.0 and SuSE 8.1
Posts: 229

Rep: Reputation: 30
If you write a script ypu have to make it executable:

chmod +x script_name
 
Old 07-13-2003, 11:49 PM   #4
angelrod
Member
 
Registered: Oct 2002
Location: Mexico
Distribution: RedHat 9.0 and SuSE 8.1
Posts: 229

Rep: Reputation: 30
Just for seconds David !!!! I have to type faster
 
Old 07-13-2003, 11:50 PM   #5
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
 
Old 07-13-2003, 11:57 PM   #6
vapor
Member
 
Registered: Jul 2003
Distribution: SuSe
Posts: 38

Original Poster
Rep: Reputation: 15
it worked...... its weird i remember doing it a other way..... o well thanks for the help i appreciate it
 
Old 07-14-2003, 12:03 AM   #7
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
you could do it like this

sh ./scriptname
 
Old 07-14-2003, 12:32 AM   #8
vapor
Member
 
Registered: Jul 2003
Distribution: SuSe
Posts: 38

Original Poster
Rep: Reputation: 15
sh! thank you now i remember lol that was the command.... o well this new way is better
 
Old 07-14-2003, 10:51 AM   #9
Pres
Member
 
Registered: Jun 2002
Location: Australia
Distribution: Slack 9.1
Posts: 232

Rep: Reputation: 30
David, your slack box is also called slacker ! My main box at work is called that.
 
Old 07-14-2003, 02:54 PM   #10
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
It seemed like a proper name for it.

Not sure why that is though, my redhat box is not called redhater or anything, but slacker seems cool. I guess it comes natural.

I have slack on my laptop now too. I am considering trying RedHat 9. I really need to catch up on the movement the RedHat is making. Things seem to be changing toward the desktop user.

I guess I can get by with only one slack box.
 
  


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
how to execute bash scripts from C????? :( cho Programming 2 06-19-2005 07:15 PM
Unable to execute sh scripts zowey Mandriva 2 12-23-2004 03:59 PM
I can't execute scripts in mounted fs Dasc Linux - General 3 12-16-2004 06:36 PM
cant execute any scripts Phonics3k Linux - Newbie 2 06-19-2002 08:00 AM
Can't execute *.cgi scripts. BrianG Linux - General 1 04-11-2001 03:38 AM


All times are GMT -5. The time now is 07:55 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