LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   execute bash scripts (https://www.linuxquestions.org/questions/programming-9/execute-bash-scripts-72488/)

vapor 07-13-2003 11:42 PM

execute bash scripts
 
whats the command to execute bash scripts u write

DavidPhillips 07-13-2003 11:48 PM

./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

angelrod 07-13-2003 11:48 PM

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

chmod +x script_name

angelrod 07-13-2003 11:49 PM

Just for seconds David !!!! I have to type faster :cool:

DavidPhillips 07-13-2003 11:50 PM

:)

vapor 07-13-2003 11:57 PM

it worked...... its weird i remember doing it a other way..... o well thanks for the help i appreciate it

DavidPhillips 07-14-2003 12:03 AM

you could do it like this

sh ./scriptname

vapor 07-14-2003 12:32 AM

sh! thank you now i remember lol that was the command.... o well this new way is better

Pres 07-14-2003 10:51 AM

David, your slack box is also called slacker ! My main box at work is called that.

DavidPhillips 07-14-2003 02:54 PM

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.


All times are GMT -5. The time now is 04:40 AM.