input variables

My script depends upon $1 to take certain actions:

file=”$1″
echo “|${file}|”

However, sometime there will leading while space which will result into:

|     output.txt|

How do I trim leading white space from one of my input variables?

{ 9 comments }