Computing.Net > Forums > Unix > line too long in a script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

line too long in a script

Reply to Message Icon

Name: Br1an
Date: October 15, 2002 at 06:26:03 Pacific
OS: Unix
CPU/Ram: 256
Comment:

Hi,

I got a script that execute a command like this :
et -A array_name `ps -ef | grep -i $process_name | grep -v 'grep' | grep -v 'kill' |grep -v $0| sort|awk '{print $2}' | sort -u`

this is bloody long ... i vaguely remember that I could actually use a backslash "\" to "cut" this line into several lines without making the shell confuse that i wanna press "enter" every times there...
Does any one know how to do this ? It would be greate, much appreciated.
Please help if you could.
Thank you very much



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: October 15, 2002 at 06:31:32 Pacific
Reply:

et -A array_name \
`ps -ef | \
grep -i $process_name | \
grep -v 'grep' | \
grep -v 'kill' |\
grep -v $0 |\
sort | \
awk '{print $2}' | \
sort -u`


0

Response Number 2
Name: Br1an
Date: October 17, 2002 at 00:56:59 Pacific
Reply:

thanks a lot David


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: line too long in a script

Awk in a script www.computing.net/answers/unix/awk-in-a-script/6027.html

line too long - how to edit this?? www.computing.net/answers/unix/line-too-long-how-to-edit-this/5819.html

Output line too long www.computing.net/answers/unix/output-line-too-long/5623.html