finding a string
Dear ALL,
I store the output of df command in a file named as /k. so in /k i have this string /dev/hdc1 24406832 666000 23740832 3% /mnt/k now i just want to store "/mnt/k" in a variable of shell script.or in a file.i dont want to use find command. can anyone help me to do this With Regards, Keerti |
str="/dev/hdc1 24406832 666000 23740832 3% /mnt/k"
var=`echo $str | awk '{print $6}'` The result is in the variable $var. |
Dear Nylex,
Thanks for the reply, I could do this by the way you suggested with Regards, Keerti |
var=`df | awk '{print $NF}'`
If you want to do it with a file , then awk '{print $NF}' filename Gentoo |
All times are GMT -5. The time now is 07:56 PM. |