Question: 1. Write a program called valid.sh that prints yes if its argument is a valid shell variable name, and no if not a valid variable.

1. Write a program called valid.sh that prints "yes" if its argument is a valid shell variable name, and "no" if not a valid variable. A valid shell variable begins with an alphabetic or underscore ( _ ) character and is followed by zero or more alphanumeric or underscore characters. Example: $ valid.sh foo_bar yes $valid.sh 123 no $ 2. Write a program called t.sh that displays the time of day in a.m. or p.m. notation rather than in 24-hour clock time. Here's an example showing t.sh run. $ date Fri Aug 5 20:14:16 CDT 2015 $ t.sh 08:14 pm (or) 8:14 pm 3. Modify the args_dollar_at program on Week 4, part 2 lecture page 5 to precede each argument by its number. So, typing:

./args_dollar_at.sh a 'b c' d should give the following output: 1: a 2: b c 3: d 4. Write a copy file program to prompt for arguments if none are supplied. The program should look like this, when you type: mycopy.sh at the Linux prompt, then hit enter, it asks Source file name? then enter any file name to be copied, then hit enter, the program then asks Destination file name? you may then enter the destination file name.

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!