Op dinsdag 15 oktober 2002 14:27, schreef jaakko tamminen:
Hi
Whe I do following: ps ax|grep 'home-main'|grep tun|cut -f1 -d' ' I get the process ID of the line: 31328 ? S< 0:00 vtund[c]: home-main tun tun1
But, if there is a space before the process-ID (ID under 9999), then the last script command "cut -f1 -d' '" does not work, because it will see the first space as a delimiter.
How can I erase the leading space(s) from that line, so the "cut" command would work with space in front of the line?
Or better yet, is there another (better?) way to get a process-id with program name and its parameter-line
Jaska.
You could use "awk" to achieve the same: ps ax|grep 'home-main'|grep tun|awk '{print $1}' -- Richard Bos Without a home the journey is endless