-
shells scripts
Consider the following shell script. Explain what lines 4, 6,7 and 9 do . What does the script output on the screen?
#!/bin/sh
MyVar=”.Blue/Green/Red/Yellow.”
echo ${MyVar#*Green}
val=${MyVar%%/*}
echo $val
MyVar=${MyVar#$val/}
val=${MyVar%%/*}
echo $val
MyVar=${MyVar#$val/}
val=${MyVar%%/*}
echo $val
MyVar=${MyVar#$val/}
val=${MyVar%%/*}
echo $val
-
Welcome to the forums!
Sorry, but this looks like homework and it's against the forums rules to post those kind of questions:
http://www.linuxforums.org/forum/lin...ums-rules.html