gringomike
Technical User
Hi All,
Is there an easy way to count the number of columns from a ps -fu output?
I'm trying to write a script that takes the value of the last column of the ps -fu output but somtimes there are 11 and sometimes there are 12 columns. If there are only 11 columns and my script is hard coded to look for field 12 I could have problems!
I hope this makes sense.
Thanks
GM
Is there an easy way to count the number of columns from a ps -fu output?
I'm trying to write a script that takes the value of the last column of the ps -fu output but somtimes there are 11 and sometimes there are 12 columns. If there are only 11 columns and my script is hard coded to look for field 12 I could have problems!
I hope this makes sense.
Thanks
GM