4 thoughts on “Learn CGI scripting using BASH in Linux Shell Scripting

  1. Good article. I want to know if the form has input type=file, how to upload file to the server in bash.

  2. @Nazeem I think that info would help me too.

    I’m not convinced about the splitting of the QUERY_STRING using awk. The first exa\mple (based on the text above) produces nothing. Not surprising when you realise the output of the first awk is piped to the input of the second:

    $ echo “aaa:bbb” | awk ‘{split($0,array,”:”)} END{print array[1]}’ | awk ‘{split($0,array,”:”)} END{print array[2]}’

    $ echo “aaa:bbb” | awk ‘{split($0,array,”:”)} END{print array[1]}’
    aaa
    $ echo “aaa:bbb” | awk ‘{split($0,array,”:”)} END{print array[2]}’
    bbb

  3. Thanks for nice article!

    That last email line wasn’t working for me, but this worked for me:
    email=`echo “$QUERY_STRING” | awk ‘{split($0,array,”&”)} END{print array[2]}’ | awk ‘{split($0,array,”=”)} END{print array[2]}’ | sed ‘s/%40/@/g’`

Leave a Reply

Your email address will not be published. Required fields are marked *