Question: Using the function $RANDOM, write a Bash script named tf . sh ( short for true or false ) that randomly sets the exit status

Using the function $RANDOM, write a Bash script named tf.sh (short for true or false) that randomly sets the exit status of the script to either 0 or 1. It should set the exit status to either value with approximately equal probability (i.e., it should simulate a fair coin).
Note that the script should produce no output; it simply sets the exit status.

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!