LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-01-2015, 04:57 AM   #1
linuxquestion12345
LQ Newbie
 
Registered: Oct 2015
Posts: 1

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


Hi

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

./start

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
regards
Kay
 
Old 10-01-2015, 05:31 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
/ww1/version15/Application/bin/start
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, 06:20 PM   #3
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
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, 06: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.

Code:
printenv PATH
Should give you something like this:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
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:
Code:
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.
 
  


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

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

All times are GMT -5. The time now is 10:38 PM.

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