Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-08-2011, 12:52 PM   #1
LQ Newbie
Registered: Feb 2011
Posts: 5

Rep: Reputation: 0
Unhappy how to execute binaries located in a different directory

Hello , i am a newbie in writing unix scripts:

I have a file with a list of arguments like:
./a arg1 arg2 arg3
./b arg1 arg2 arg3
./n arg1 arg2 arg3

but these binaries (a,b,..etc) are in a different sub directory from where the above file is located. How do I write a script that will pick up each line from the file and execute it.
Old 02-08-2011, 02:21 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Something like this (substitute "my/xyz/dir" for your actual path):

$EXE_DIR/a arg1 arg2 arg3
$EXE_DIR/b arg1 arg2 arg3
$EXE_DIR/n arg1 arg2 arg3
There are many more - and much more elaborate - things you can do. But I hope this gets you started in the right direction.
Old 02-08-2011, 02:46 PM   #3
LQ Newbie
Registered: Feb 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks so much... that was helpful


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
In what directory is the kernel located in OpenSuSE10.2 terryt6200 Linux - Newbie 1 05-06-2009 09:10 AM
can Solaris Express Dev. Ed. execute Linux binaries ? dragoncity Solaris / OpenSolaris 11 04-14-2008 07:52 AM
Where are drivers located (which directory)? moxieman99 Linux - Newbie 3 01-16-2006 03:46 PM
problem with NASM - can't execute binaries boz Programming 1 06-30-2005 12:54 AM
What directory is SAMBA located? mysticpain Linux - Software 2 08-18-2004 01:37 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration