Hi,
Actually I am want to cut the three fields of "file-nr" file.
[yogender@gfmdatabase yogender]$ cat /proc/sys/fs/file-nr
638 219 52270
I want to assign these value to diffrent varibales as follow:-
a=638
b=219
c=52270
I tried to use cut command for this purpose and also tried to squeeze all sapces to a single space, but didn't succed.
I know file-nr is a read only file but there would be any way to cut these fields/values.
Kindly help me with this.
Thanks -
Yogender
if it IS read only... no way. you can't "cut" the values from the file but you can assign them to varibles anyway...
Hi DukeNuke,
Could you Please suggest how can i assign these values to three diffrent variables?
Thanks-
Yogi
era
4
set -- `cat /proc/sys/fs/file-nr`
a=$1
b=$2
c=$3
Thanks Era,
I got a good learning. It's working for me.
Regards,
Yogi
Is this something realted to positional parameters??
era
7
Yes, set -- allows you to set the positional parameters from basically an arbitrary input.