views:

508

answers:

3

I write a simple shell script which could be run like this

$ksh script1

But i donn't know how to execute it.Like

$script1

thanks.

+1  A: 

Not sure if it works on AIX but on Linux you can say chmod +x script.sh to make it executable using ./script.sh in the script's directory or using /the/full/path/to/script.sh (if the script isn't in the system path)

Jake
chmod +x script.sh will not look for script.sh in the system's PATH.
JesperE
A: 

to make it executable

chmod 755 /folder/of/your/script/script.sh

to make it callable from any folder in the system

export PATH=$PATH:/folder/of/your/script

to make it callable only from script.sh folder

export PATH=$PATH:.
Abu Aqil
A: 

Just do the following:

$ chmod u+x script1
$ ./script1

It's not recommended to add "." to your PATH environment variable due to security reasons.

Barun