1

Printing a part of the last line of the specific part of a file

view story
linux-howto

http://www.unix.com – Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Code: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which contains a string "Value =[...]" Next, I want to get the value 57 and assign it to a variable (this is an example because each file has different value) I tried to use this command: Code: VALUE=`sed -n '/Name = A/,/Value =/p' $file | tail -1 | gawk '{printf $3"\n"}'` Unfortuna (HowTos)