Search Results

Search: Posts Made By: endorphin
28,905
Posted By endorphin
Evaluate string containing shell variable names
Hello,

I have this:

#!/usr/bin/ksh
V1=ABC
str="hello 123;${V1}"

eval "echo $str"

i get


hello 123
/script.sh ABC not found


However eval works if $str variable doesn't contain...
Showing results 1 to 1 of 1

 
All times are GMT -4. The time now is 03:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy