Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grep command error UID: command not found

Status
Not open for further replies.

rigstars1

Instructor
Oct 2, 2010
19
US
This command greps for 'unlinkd' which works fine

ps -l -u squid | grep unlinkd | cut -c 96-102

but as soon as I put it in a script ..the output is always the word 'UID'
Any one know why that is?

variable=(`ps -l -u squid` "| grep unlinkd | cut -c 96-102")
 
Code:
variable=`ps -l -u squid | grep unlinkd | cut -c 96-102^

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV -

I'm not sure what the '^' does but it didn't work. I just misplaced my backticks. Now it works. Nice try though. Appreciate the effort.

`ps -l -u squid | grep unlinkd | cut -c 96-102`
 
Sorry for the typo.
Obviously the ^ should be read as `
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top