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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!