Results 1 to 4 of 4

Thread: parameter expansion & substitution errors

Threaded View

  1. #1
    Join Date
    Apr 2008
    Location
    Southern California, USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    parameter expansion & substitution errors

    I have this error that uses parameter expansion and parameter substitution, but I get errors. Can you spot the reason for the error?

    Code:
    #!/bin/sh
    
    echo "AQ wE rTy  Ui  Op"
    
    selection="AQ wE rTy  Ui  Op"
    
    choice=${selection// } #remove spaces
    
    choice2=${selection,,} #lower case
    
    echo $choice
    
    echo $choice2
    Here's the error: ./x: 5: ./x: Bad substitution

    This is just a simple snippet showing the error from a much larger script.

    I found the simple error, I just wasn't expecting it.

    The original script was showing most of the functions of zenity, found here.
    Last edited by VMC; June 15th, 2013 at 10:31 PM. Reason: error

Bookmarks

Posting Permissions

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