Question: Write a script to determine whether the given command line argument ($1) contains * symbol or not, if $1 does not contain * symbol then
Write a script to determine whether the given command line argument ($1) contains "*" symbol or not, if $1 does not contain "*" symbol then add it to $1, otherwise show the message "Symbol is not required". For example, if we called this script sc2 then after giving the command: $sc2 /bin Here $1 is /bin, the script should check whether "*" symbol is present or not. If not, then the script should print "*" is required and add the "*" to $1, i.e. /bin/*. And if the "*" symbol is present in $1, then, the script should print Symbol is not required
I need the answer in shell command
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
