LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-19-2011, 04:13 AM   #1
greenpool
Member
 
Registered: Sep 2010
Posts: 41

Rep: Reputation: 0
Question 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.

Last edited by greenpool; 08-19-2011 at 04:48 AM. Reason: more info
 
Old 08-19-2011, 04:21 AM   #2
pix9
Member
 
Registered: Jan 2010
Location: Mumbai, India
Distribution: Fedora 24 , Centos 7.0
Posts: 170

Rep: Reputation: 19
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
 
Old 08-19-2011, 04:46 AM   #3
greenpool
Member
 
Registered: Sep 2010
Posts: 41

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pix9 View Post
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.
 
  


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
Fork bombs can also very easily be standalone shell scripts Kenny_Strawn Linux - Security 4 12-12-2010 10:25 PM
Easily access XP network jesrani Linux - Networking 6 06-25-2009 08:33 AM
execute bash scripts vapor Programming 9 07-14-2003 02:54 PM
cant execute any scripts Phonics3k Linux - Newbie 2 06-19-2002 08:00 AM
How to set up access right easily J_Szucs Linux - Newbie 2 02-11-2002 12:36 PM


All times are GMT -5. The time now is 06:41 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration