Send cut output to basename


 
Thread Tools Search this Thread
Operating Systems Solaris Send cut output to basename
# 1  
Old 11-09-2009
Send cut output to basename

Hi,

I'm running a command :
Code:
pargs 20392 | egrep -e "-f "|cut -d " " -f3 | basename

BUT the o/p of cut is not sending to basename.
the o/p of: pargs 20392 | egrep -e "-f "|cut -d " " -f3 is

/home/staff/Properties.cfg

Appreciated ur help..

Last edited by pludi; 11-09-2009 at 09:33 AM.. Reason: code tags please...
axes
# 2  
Old 11-09-2009
basename does not read from stdin (be it a pipe or terminal), but acts on it's command line parameter. So your command should rather be
Code:
basename $( pargs 20392 | egrep -e "-f " | cut -d " " -f3 )

# 3  
Old 11-09-2009
Thanks pludi, It's working.
axes
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I want query output to send on mail using table tag and output should be in table

#! /bin/ksh #] && . ./.profile 2>/dev/null if test -f '.profile'; then . ./.profile; fi; #. .profile LOG_DIR=/app/rpx/jobs/scripts/just/logs sendEmail() { pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7" ( ... (21 Replies)
Discussion started by: ankit.mca.aaidu
21 Replies

2. Shell Programming and Scripting

Cut an output

Hi everyone, happy new year I have the following output: 2503 nteath 20 0 4892 312 2503 nteath 20 0 5872 312 2503 nteath 20 0 6852 312 2503 nteath 20 0 7832 312 2503 nteath 20 0 8812 312 2503 nteath 20 0 9792 312 2503 nteath 20... (3 Replies)
Discussion started by: nteath
3 Replies

3. UNIX for Dummies Questions & Answers

Cut an sql script output

Hi i want to cut the first field of this output obtained form sql script more dxlocks_test.log.1 SID SERIAL# SPID ---------- ---------- --------- 25 18356 1029 78 39370 1025 136 14361 1027 ================================ cut -f1... (2 Replies)
Discussion started by: aishwaryakala
2 Replies

4. Shell Programming and Scripting

how to cut from output

Hi How do i cut from this output so i only get db name ps -ef |grep smon oracle 29375 1 0 Nov 9 ? 8:08 ora_smon_HWEX62 i.e only want HWEX62 also bearling in mind that some database have been running from hours and some servers have different time and date formats... (7 Replies)
Discussion started by: eb222
7 Replies

5. Solaris

how to send the output

Hi, how to send the output of a command directly to a file. For eg: am issuing metastat -a. How to send the output of this command to a file as well as mail. (3 Replies)
Discussion started by: rogerben
3 Replies

6. UNIX for Dummies Questions & Answers

problem with output of find command being input to basename command...

Hi, I am triying to make sure that there exists only one file with the pattern abc* in path /path/. This directory is having many huge files. If there is only one file then I have to take its complete name only to use furter in my script. I am planning to do like this: if ; then... (2 Replies)
Discussion started by: new_learner
2 Replies

7. Shell Programming and Scripting

how to cut off last column from the output

I have a problem with my script. I am using following code awk -F"," '{print $0,",",substr($2,3,3)}' $REG_InputFileName > $TargetSeqPath/Master.tmp while read i do echo $i > $TargetSeqPath/Ref.tmp OutFileName=`awk -F"," '{print $3}' $TargetSeqPath/Ref.tmp` rm -f... (9 Replies)
Discussion started by: manmeet
9 Replies

8. Shell Programming and Scripting

cut - columns with formatted Output

Hi I have the input file as below ***TEST10067 00567GROSZ 099 00567CTCTSDS90 ***TEST20081 08233GROZWEWE 00782GWERW899 ***TEST30088 08233GROZWEWE 00782GWERW899 I am finding the lines starting with *** and outputing as below TEST10067 TEST20081 TEST30088 I need a space between TEST1... (9 Replies)
Discussion started by: dhanamurthy
9 Replies

9. Shell Programming and Scripting

need grep to output basename and line#

I have a script that sorta works the way I want but I would rather just get the base name and line number from the grep output. My current script is this one liner: grep -n "$1" $SCCSPATH/*/s.*.k | cut -c1-80 which if I was searching for 121197 I would get something like this: ... (18 Replies)
Discussion started by: zoo591
18 Replies

10. UNIX for Dummies Questions & Answers

How can I cut output of command??

I am on a Linux system using bash shell. I only want to see the number in the Use% field as the output. #df -h / Filesystem Size Used Avail Use% Mounted on /dev/dasda1 2.3G 2.1G 51M 98% / !#/bin/bash df -h / | awk '{print $5}' | cut -c1-2 Us 98 How do... (2 Replies)
Discussion started by: darthur
2 Replies
Login or Register to Ask a Question