how is it possible to run these two commands and then truncate them to the end of the curly bracket? thanks
a=g; z="abcdefgh"
echo ${z%%$a*}
error:
echo ${z%%$a:0:4}
echo ${z//ab/01}
error:
echo ${${z//ab/01}:0:4}
How should that look? I wanted to make it as compact as possible and because of the extensive possibilities of the commands in curly brackets it seemed sensible to me to combine two commands and in the latter to separate the output of the first.
a=g; z="abcdefgh"
echo ${z%%$a*}
error:
echo ${z%%$a:0:4}
echo ${z//ab/01}
error:
echo ${${z//ab/01}:0:4}
How should that look? I wanted to make it as compact as possible and because of the extensive possibilities of the commands in curly brackets it seemed sensible to me to combine two commands and in the latter to separate the output of the first.