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
More Related Questions
- Unix Script - "Using "if" statement checks for a file called "student.txt" in ...
- linux networking - What are two ways you can execute a shell script when you do ...
- operating system - I been working on this forever can you please show fully how ...
- bookkeeping - Using your computer, you create a file for an existing costumer. ...
- offfice finaces - Using your computer software, you create a new file for an ...
- C++ - File version maintenance utility A team of software developers has been...
- Literature - When you save documents, it is important to check the _____ at the ...
- programming - b. Write a well-commented C++ program that reads data from the ...
- Microsoft word - Suppose you want to delete an existing file from within Word. ...
- Ed. Tech - When you save documents, it is important to check the blank at the ...