Advanced Bash Scripting Guide

Looks good at first blush, the following link may be to an out-of-date version. Convert something to lowercase in a bash script.

Advertisements

3 Responses to “Advanced Bash Scripting Guide”

  1. ropata Says:

    for filename in `ls`
    do lowercasefilename=`echo $filename|awk ‘{print tolower($1)}’`
    mv filename lowercasefilename
    done

  2. ropata Says:

    oops forgot to put $ prefixes on variables on line 3

  3. dale77 Says:

    Thanks for that alternative method ropata. Here’s what worked for me:

    for filename in $(ls)
    do lowercasefilename=`echo $filename | awk ‘{print tolower($1)}’`
    echo $lowercasefilename
    #mv $filename $lowercasefilename
    done

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: