bash variable
by JJJCR from LinuxQuestions.org on (#55DEX)
Hi guys, need your help any work around on this?
Quote:
any ideas on below:
Quote:
Tried below but doesn't seem to work:
mypath=$(head -n 1 "/tmp/$varpath")
mypath=$(head -n 1 {/tmp/$varpath})
Thanks for any help.


Quote:
mypath=$(head -n 1 /tmp/xpath.txt) <--working fine able to read first line of file |
Quote:
mypath=$(head -n 1 /tmp/$varpath) <--got a filename that is a variable this one does not seem to work mypath returns empty |
mypath=$(head -n 1 "/tmp/$varpath")
mypath=$(head -n 1 {/tmp/$varpath})
Thanks for any help.