Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in variable

Status
Not open for further replies.

RicardoPereira

Programmer
Jun 3, 2003
255
PT
I must rename a file using the content of a file.

In my stderr.log i have:
2541

---------------

Now in my script i have the code to get the number:
let NR=`tail -3 /home/xback/dmsbck.info/tmp_dados.info | head -1`


this should get the 2541, but i got the error
bash: let: NR=: syntax error: operand expected (error token is "=")

What should i do to get this number and put in a variable?

Thanks in advanced
 
do not use "let", now, if the result of the command is a text use:

NR="[color]`tail -3 /home/xback/dmsbck.info/tmp_dados.info | head -1`"[color]

just in case...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top