LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to access and execute scripts easily? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-access-and-execute-scripts-easily-898244/)

greenpool 08-19-2011 04:13 AM

how to access and execute scripts easily?
 
Hi there,

i currenly work in an evironment where we use a lot of scrpts.

my local folder: /home/userx

the scripts are located in:
Code:

/data/home/sr671111/bin
creating a symolic link to '/data/home/sr671111/bin' was easy. i have labeled the link 'scripts'.

everytime a script needs to be executed i need to do the following:

Code:

su -u sr61111 ./scriptName

at the moment i've creatd an alias such as:

Code:

alias ex ='su -u sr61111'
this allows me to execute the script as:

Code:

ex ./scriptName
I'm new to linux but i still feel there must be a better way to do this.

I'm sure guys have some ideas you might be kind enough to pass my way? :)

thanks!


Addendum:

Just want to you let you know that there are about 30 scripts in '/data/home/sr671111/bin'. I don't have the right to move them.

pix9 08-19-2011 04:21 AM

well if you want to share those scripts with all the user of system, or you want to make them executable by any one
In that case you can place them into folder "/usr/local/bin"
And they can be executed like any other command or script by file name itself. Make sure you give them appropriate permission them
$ ln -s /path/to/original/script /usr/local/bin/myscript

$ chmod o+x /usr/local/bin/myscript

$ myscript

hope that helps you.


Thank you
Pushkar

greenpool 08-19-2011 04:46 AM

Quote:

Originally Posted by pix9 (Post 4447557)
well if you want to share those scripts with all the user of system, or you want to make them executable by any one
In that case you can place them into folder "/usr/local/bin"
And they can be executed like any other command or script by file name itself. Make sure you give them appropriate permission them
$ ln -s /path/to/original/script /usr/local/bin/myscript

$ chmod o+x /usr/local/bin/myscript

$ myscript

hope that helps you.


Thank you
Pushkar


Thanks but I am not the admininatrator of those scripts, just another user. I am merely looking for a way to easily execute them from user point of view.


All times are GMT -5. The time now is 02:58 PM.