Shell Script To Translate All Characters In a File To Lowercase

in Categories File-management last updated September 16, 2008

This command uses tr command to translate all uppercase characters to lowercase characters in a file.


Share this on:

3 comment

  1. I have problem with this script (the program count the number of lines in the file specified by the second command-line option that begin with the letter i.) , the output is :
    erorr (can’t found ‘grep ^i $2 | WC -1’ ) , please can you help me to fix the problems

    shell script:
    #!/bin/bash
    #tarek_20307
    #exercise 3:

    case $1 in
    -i)
    count= ‘grep ^i $2 | WC -1′
    echo “The Number of LINES in The $2 That begin with the letter i IS $count”
    ;;
    -e)
    count=’grep ^e $2 | wc -1’
    echo “The Number of LINES in The That begin with the letter e IS”
    ;;
    *)
    echo “error: this option is incorrect ”
    ;;
    esac

    Have a question? Post it on our forum!