Hi everybody,
im writing a bash script, and receiving entry from a user, and i need to check if the word has any wildcards in.
do u have any ideas please .
thanks .
Hi everybody,
im writing a bash script, and receiving entry from a user, and i need to check if the word has any wildcards in.
do u have any ideas please .
thanks .
If a user enters a wildcard it will be globbed (expanded) by the shell. You will not see a wildcard in the result you read in.
Unless you turn off globbing in your script.
set -o noglob
read filename
-- check for wilcards or do something with filename here
set +o noglob
Do not post questions without trying to solve the problem yourself based on your understanding. Post what have you tried so far and where exactly are you stuck?