I have a string dk of length N, and a numeric value NDK.
If N is less than NDK I want to append the difference from the start of another string called SYMBOL.
if (( n < ndk )); then
df=$(( ndk - n ))
fi
Thus if the difference df is 2, I want to append the first two characters from the string SYMBOL to the string DK.
symbol="!@#$%^&"
df=2
dk="FIRST"
With the resulting value of dk being
"FIRST!@"
How can I append the additional df characters from the beginning of string SYMBOL ?
$dfis larger than${#symbol}(the length of the$symbolstring)?DFis always less than the length ofSYMBOL.