You may be tempted to put all of this info in a single record in a file
This is not a good practice. It has duplicate data (namely, the passwords). If you change the password on a device, you do not want to change it in multiple records in this file. This increases the chance of error and your data may lose its integrity.
What if we have a problem when reading files?
The user mistypes the nickname and it isn’t in
$? Returns a value based on the success of the previous command
0 means successful
Another number is not successful (such as 1)
The read command
can give us a code to check for end-of-file, in case we read to the end of the file
Error checking and options
not equal to
greater than or equal to
less than or equal to
field test operators
file exists and is readable
file exists and it is writable
file exists and is it nonzero
file exists and is it not a directory
file exists and is it a directory
If the filename doesn’t exist,
prompt the user for the filename until the user enters a valid filename.
We’ll need a loop.
both criteria must be met
either criteria must be met
if te result was true change to false, if the result was false change it to true