Posted by Tina on Saturday, February 26, 2011 at 1:47pm.
Using "if" statement checks for a file called "student.txt" in the current directory. Removes (deletes) the file if it exist. This file will collect last name, first name, and grade for 5 people.
Use a while loop to get the information (last name, first name, and age) for 5 people. grade should be 0-100. Use three different variable names (fname, lname, and grade) to read the data from the keyboard.
Store the data read from the keyboard in a file called "student.txt". After reading all the data for 5 people, display contents of name.txt file on the monitor.
Below is my attempt
if [ -f name.txt ]; then
# I put something in here and it'll be done if the file exists
while [ $person_num -lt 6 ]; do
# put something here to repeat for each person
person_num = $(eval $person_num + 1)
# read name.txt file
Answer this Question
physic - 3) A shell is fired from ground level with a muzzle speed of 350 ft / s...
calculus - 3) A shell is fired from ground level with a muzzle speed of 350 ft...
maths - If the weight of a spherical shell is 7/8th of what it would be if it ...
operating system - I been working on this forever can you please show fully how ...
calc 3 - The length script l, width w, and height h of a box change with time. ...
physics - A cannon fires a shell at an angle of 20º to the horizontal. The shell...
programming - can someone write this script with unix The script should be named...
Math / Physics - Many birds drop clams or other shell fish in order to break the...
computers - I need some help with creating a simple, but automatic site status (...
science - a shell is fired from the cannon. the shell of mass 30kg is shot with ...