LinuxQuestions.org
Visit Jeremy's Blog.
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-07-2003, 02:39 AM   #1
davee
Member
 
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Rep: Reputation: 30
How do I run a command in script from a particular directory?


I need to write to a Notes/Domino log file - the command has to be run from the domino data directory... eg:

cd /notes/domino
/opt/lotuus/bin/server -c "###### log message ######"

i.e. I have to change into /notes/domino first, as the server program relies on files in this dir.

How do I do this in a script? I know I can add the lines as above to the script, but is this reliable?

Dave

Last edited by davee; 08-07-2003 at 02:57 AM.
 
Old 08-07-2003, 03:22 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
You simply put the cd line in your script as you suggested. I don't see why it should have any reliability problems, but I may be missing something.

cheers

Jamie...
 
  


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
chroot: cannot run command `/tools/bin/env': No such file or directory Basel Linux From Scratch 10 06-09-2018 02:15 PM
Whats the command that allow you to run a script as another user? ziggie216 Linux - Software 3 11-10-2005 03:05 AM
script/command to delete all symlinks from a directory reddazz Linux - General 5 03-15-2005 11:39 PM
Specifying target directory for command in bash shell script? spectrescape Programming 1 07-22-2004 05:37 PM
Run script during file copy or create in directory neranjana Linux - General 1 01-13-2004 06:57 AM

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

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