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 10-01-2015, 05:57 AM   #1
LQ Newbie
Registered: Oct 2015
Posts: 1

Rep: Reputation: Disabled
basic unix script--but tough for me


I simply want to make a script for a executable file for which i have to go in many directories to execute.

this is what i do:-

cd /ww1/version15/Application/bin

when i go in above directory i then type in following executable command


this opens up my application..

Instead of doing all that i want to create a script when i run should launch my application...any help would be appreciated..

many thanks
Old 10-01-2015, 06:31 AM   #2
LQ Guru
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,777

Rep: Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888
probably works - or - you can create a script containing two lines:
cd into your dir
start your app
as it was described in your initial post
Old 10-01-2015, 07:20 PM   #3
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 361

Rep: Reputation: 157Reputation: 157
You wrote that you need to run the command in many directories. Could you give us some more details, like how many directories you need to process, and how the directories will be selected? If you want to do all the directories automatically, the find command may be useful.
Old 10-01-2015, 07:55 PM   #4
Can-ned Food
LQ Newbie
Registered: Apr 2015
Distribution: GNU→TT
Posts: 7

Rep: Reputation: Disabled
symlink in a $PATH dir?

It sounds like the OP wants the /ww1/version15/Application/bin/start executable from every directory.

To do this, you can either add /ww1/version15/Application/bin/ to your PATH envar (not preferrable) or you can simply add the desired file to one of the PATH directories.

printenv PATH
Should give you something like this:
You can add a symlink to your program to one of those paths. Ideally it would be in '/opt/bin/', but you can start off by adding it to some other path which is already in the PATH variable:
sudo ln --symbolic /ww1/version15/Application/bin/start  /usr/local/games/ww1
This will make a symbolic link in named 'ww1' which when opened will point to the file in its original location.
BTW if it isn't a WWI game then you might not want it in a games/ folder, so change the '/usr/local/games/' directory to something else.


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
[SOLVED] *****basic unix commands****** ramchandergolla Linux - Newbie 3 10-20-2011 02:32 PM
Tough script mmahulo Linux - Newbie 21 02-07-2009 03:38 AM
Help with a basic UNIX script mike9287 Linux - Newbie 28 06-02-2006 03:14 AM
Basic Unix commands req dark_light Linux - Newbie 7 04-04-2002 07:33 PM
How to schedule unix script periodically from unix os level??? gopi_20us Programming 2 03-11-2002 07:45 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:26 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