Following code puts the proper value in $monthdata
and $daydata
but when I try to print them out concatenated it does not work.
month05="AD"
day25="QGTKDO"
curmonth=$(date +"%m")
eval monthdata="\$month$curmonth"
curday=$(date +"%d")
eval daydata="\$day$curday"
c="$monthdata$daydata"
echo $c
This echo outputs "QGTKDO". If c="$daydata$monthdata" then the output is "ADTKDO", as if instead of concatenating it overlays them. I Am on BusyBox v1.23.1
Sounds like your script has DOS line-endings (so the strings do). Try running dos2unix or similar on it. Also see the bash info page as this is one of the first suggestions on there. – Etan Reisner
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments