LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 02-08-2011, 12:52 PM   #1
pghosh06
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
paulsm4
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):
Code:
EXE_DIR=/my/exe/dir
DATA_DIR=/my/data/dir

cd $DATA_DIR
$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
pghosh06
LQ Newbie
 
Registered: Feb 2011
Posts: 5

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:49 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
Open Source Consulting | Domain Registration