treating multiple delimiters[solved]

Hi, I need to display the last column value in the below o/p.

sam2  PS    03/10/11    0  441

Unable to get o/p with this awk code

awk -F"[/]+" '{ print $4 }' pwdchk.txt

I need to display 441(in this eg.) and also accept it as a variable to treat it with if condition and take a decision. Requesting help.

---------- Post updated at 08:53 PM ---------- Previous update was at 08:45 PM ----------

Oh! just hit upon an idea

awk -F"[/ ]+" '{ print $7 }' pwdchk.txt

I do get o/p as 441; but is it correct way? Just did on trial and error basis. Please suggest/explain.

you can just do this to store the last column in a shell variable...

VAR=$(awk '{print $NF}' file)

where file contents are...

sam2  PS    03/10/11    0  441
1 Like