Article 55DEX bash variable

bash variable

by
JJJCR
from LinuxQuestions.org on (#55DEX)
Hi guys, need your help any work around on this?

Quote:
mypath=$(head -n 1 /tmp/xpath.txt) <--working fine able to read first line of file
any ideas on below:
Quote:
mypath=$(head -n 1 /tmp/$varpath) <--got a filename that is a variable this one does not seem to work

mypath returns empty
Tried below but doesn't seem to work:

mypath=$(head -n 1 "/tmp/$varpath")

mypath=$(head -n 1 {/tmp/$varpath})

Thanks for any help.latest?d=yIl2AUoC8zA latest?i=TVq-tzRBHKA:owxdmwPr_z4:F7zBnMy latest?i=TVq-tzRBHKA:owxdmwPr_z4:V_sGLiP latest?d=qj6IDK7rITs latest?i=TVq-tzRBHKA:owxdmwPr_z4:gIN9vFwTVq-tzRBHKA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments