On Fri, Apr 17, 2015 at 09:51:04AM +1000, Guillermo Buritica Tobon wrote: > H have the next bash script code.: > > #!/bin/sh
This is not bash. This is sh. > read INPUT Avoid using ALL-CAPS variable names. All-caps names are reserved for internal shell variables, and environment variables like PATH or HOME. Use at least one lower-case letter in your regular variables. > if [ -z "$INPUT" ]; then > echo OK > else > echo $INPUT Never omit the quotes around an expansion unless you KNOW you're doing it in a context where it's safe. This is not such a context. echo "$INPUT" > The ISSUE is when the string Contain "*" the results are very estrange. or > "*[space]" This is PRECISELY why you must quote your variable expansions. If you fail to quote them, the results undergo word splitting and pathname expansion. This is what you are seeing. Always quote your variable expansions. echo "$INPUT"