Command execution from other directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Command execution from other directory
# 1  
Old 07-10-2013
Command execution from other directory

Hi,

I need to execute some commands in a directory.

script called test.sh from /usr/bin/

and the commands which are there in the script needs to be executed from /etc/ and come back to another directory /lib/ and execute some commands which are there in the script.

Hope you understand the issue.
# 2  
Old 07-10-2013
Code:
cat test.sh

cd /usr/bin
commands
cd /etc
commands
cd /lib
commands

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Execution of command at command prompt

Hello Experts, I am still learning linux and have come across a question, hope to get some answer. I have two servers, and both have the same version of svn client installed and both have the same user_id. my SVN client version: svn, version 1.6.11 (r934486) compiled Mar 2 2011,... (4 Replies)
Discussion started by: babyPen1985
4 Replies

2. Shell Programming and Scripting

Multiple command execution inside awk command during xml parsing

below is the output xml string from some other command and i will be parsing it using awk cat /tmp/alerts.xml <Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies

3. Shell Programming and Scripting

Want to terminate command execution when string found in the command output

Hi Experts, I am very much new to linux scripting, I am currently working on reducing my manual work and hence writing a script to automate few task. I am running below command to snmpwalk the router.. snmpwalk -v 3 -u WANDL_SU -a MD5 -A vfipmpls -x DES -X VfIpMpLs -l authPriv... (19 Replies)
Discussion started by: Hanumant.madane
19 Replies

4. Shell Programming and Scripting

Multiple command execution

I want to open more than 2 files(f1,f2). commands for opening those files are stored in one file (f3). command to execute the file (f3). (3 Replies)
Discussion started by: Mahendravarma
3 Replies

5. Shell Programming and Scripting

Code for execution command by command

a) cd /root/user/dir/sd/disk ./runInstaller -silent -responseFile b) cd /root1/user1 cp /root/user/dir/sd/disk/ram.txt now a) executes and starts running but b) interupts a) and is executed while a) is running on the other hand so I want b) to start only after successfull completion of... (6 Replies)
Discussion started by: sriki32
6 Replies

6. UNIX for Advanced & Expert Users

command execution alert

hi Guys! My requirement is... I need to get notified if somebody executes a specific commands...like kill or httpd stop.... something like that.... can somebody help me out... Regards, kiran (8 Replies)
Discussion started by: dddkiran
8 Replies

7. Shell Programming and Scripting

Remote command execution

We have multiple Unix servers and a particular command can only be executed in one of the box from a specific path. I have password-less ssh set up for all the boxes. I am unsure the command to use to execute that particular command from any other box. To be specific say program named _my_exe_ can... (4 Replies)
Discussion started by: uunniixx
4 Replies

8. Shell Programming and Scripting

slow command execution?

Dear World, I just wrote a script, which puzzled me somewhat. The siginficant code was: for file in `ls splits*`; # splits* came from a split command executed earlier do tail -$SomeNumber $file | cut -d" " -f6 > $file; done; The interesting thing is this: A few of the $files were... (2 Replies)
Discussion started by: BandGap
2 Replies

9. Shell Programming and Scripting

Script execution dependent upon a file landing in a certain directory

Hi all, I'm looking to write a script that is dependent upon the existence of 2 files each in separate directories. My thought was to do: **psuedo code ** execute script check directory 1 for file1 if file exists then execute script 2 ( checking directory 2 for file 2) else... (3 Replies)
Discussion started by: keladar
3 Replies

10. UNIX for Advanced & Expert Users

command execution ??

hi i have small shell script as follows cd /utilities/promoter/tmp grep SENDREPLY $1 | grep 'zzzzz@zzz.com' | awk -F" -f1 > /tmp/$LOGNAME/$1.request cd /tmp/$LOGNAME grep -e "\.sql" -e "\.md" $1.request > upd_$1.txt grep -v -e "\.sql" -e "\.md" $1.request > copy_$1.txt ... (1 Reply)
Discussion started by: zedex
1 Replies
Login or Register to Ask a Question