Re: need help with awk
Thanks for your reply Kumar,
><code>
>BEGIN { proces_line = 0; }
>
>/startprocessing_regexp/ { process_line = 1 }
>
>process_line {
> /* Do stuff */
>}
>
>/stopprocessing_regexp/ { process_line = 1; }
>
I'm not familiar with the syntax you usei'm gonna look at it soon, but
for sure your method is less ugly than mine.
But for today, I finaly get bored and used a successive usage of "
| "s :-D. Now the code is nearly unreadable if you don't read it
carefully but it works !
#echo disk = [ file:/path/to/file,sda1,w ] | awk -F= '{print $2}' |
awk -F[ '{print $2}' | awk -F= '{print $1}' | awk -F, '{print $1}' |
awk -F: '{print $2}'
/path/to/file
The point is if i have more than one `disk` argument, i'll have to
find a way to identify each of them... But lets keep some work for
tomorrow :)
--
Guillaume
Reply to: