Click to See Complete Forum and Search --> : running .sh scripts?


cibressus
05-09-2004, 07:30 PM
i downloaded a .sh file/script.

how do i run it?

bsh152s
05-09-2004, 07:40 PM
1. Open up a terminal
2. Change to directory where script is located (cd path/to/your/dir)
3. Make sure you have executable permissions (chmod u+x yourscript.sh)
4. run script (./yourscript.sh)

cibressus
05-09-2004, 07:44 PM
I can't do it. I get this. i know i'm being realy dumb right now, but i'm a real noob at this.

[cibressus@localhost cibressus]$ dir
check.sh Desktop evolution modules.php ut2004
[cibressus@localhost cibressus]$ chmod u+x check.sh
[cibressus@localhost cibressus]$ run script(check.sh)
bash: syntax error near unexpected token `('
[cibressus@localhost cibressus]$ run check.sh
run: unable to exec
[cibressus@localhost cibressus]$

X_console
05-09-2004, 07:54 PM
You're taking the "run script" part literally. :) It should be:

./check.sh

cibressus
05-09-2004, 08:00 PM
man, that was pretty cool, it's like a bat file on crack.

i guess i'm still used to dos commands were it's command arguement -varible -varible...

DSwain
05-09-2004, 08:18 PM
man, that was pretty cool, it's like a bat file on crack.

lmao!


that's great... err, yes bash scripting is very powerful, more so than batch as far as i've read. Kind of hard, but once you get very good with the console its a miracal to script large operations. Good stuff (i'm learning much myself still btw)

talha999
05-09-2004, 08:31 PM
other way of running it like

sh check.sh

Regards

roamingnomad
05-09-2004, 08:58 PM
command arguement -varible -varible...

Well, actually, it is that way. Just your script is your command! :p

And yes, bash scripting is really awesome. Just like 3/4 of everything else in Linux. (the other 1/4 is the really... frustrating stuff that's not fun to play with.....)

DSwain
05-09-2004, 09:25 PM
hmm, interesting way to put it. i like it, except slightly different:

Break down any Linux thing into fourth's. The first fourth, is learning and fighting. very frustrating and irritating. After that though, the rest is fun, and you realise how worth it it was to deal with the first quater. Kind of like this is my...5th Stage1 gentoo install and i think i got it this time. I already notice speed differences, and i'm not even done installing! very satisfying

bwkaz
05-09-2004, 09:28 PM
Whoa whoa whoa, hang on a second! Did I see you type "dir" there?

Yeesh. :D

ls please... ;)