Find the answer to your Linux question:
Results 1 to 2 of 2
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/} ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    2

    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

  2. #2
    oz
    oz is online now
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,090
    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
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...