command execution ??

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users command execution ??
# 1  
Old 11-01-2007
Error command execution ??

hi i have small shell script as follows
cd /utilities/promoter/tmp
   grep SENDREPLY $1 | grep '' | awk -F"[" '{print $4}' | cut -d] -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

now when i execute this code in debug mode i get following output
(mhatrnin)hpux1570:/idcuser/mhatrnin>sh -x ./GenerateReq 13227
+ cd /utilities/promoter/tmp
+ grep SENDREPLY 13227
+ grep
+ cut -d] -f1
+ awk -F[ {print $4}
+ 1> /tmp/mhatrnin/13227.request

one thing i mnot getting is that why cut is 1st executed when its after awk in actual command ?
# 2  
Old 11-06-2007
There is no issue with the script, in debug mode it will display like that but AWK will execute first.
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

Command execution from other directory

Hi, I need to execute some commands in a directory. script called 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... (1 Reply)
Discussion started by: munna_dude
1 Replies

3. 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

4. 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

5. 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

6. Shell Programming and Scripting

both sides execution of command

Hi, i am struggling with a chunk of code. for ((i=1; i<=3; i++));do one-$i ="/tmp/one.$RANDOM" done How to execute the above code. In both sides(LHS and RHS), i am executing commands. it is not allowing to execute. can you please give the idea. It should be very... (8 Replies)
Discussion started by: munna_dude
8 Replies

7. Solaris

get the total execution of command

hi, i have to get the info between start to stop of a command execution suppose, if we execute the command like pkgadd then while its executing it ask some questions , i have to get total information untill pkgadd command complete into a perticular file. (3 Replies)
Discussion started by: shankr3
3 Replies

8. UNIX for Dummies Questions & Answers

Command execution in grep

I'm taking Unix Scripting course and we've been given the following command grep -l "`echo '\t'`" foo What this command is basically doing is giving the lines in the ordinary file foo that contains the letter 't'. From my understanding, command substation occurs first. So echo '\t' is... (2 Replies)
Discussion started by: kkhan00
2 Replies

9. 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

10. 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
Login or Register to Ask a Question