Exercise to create a shell script which interactively (by asking user for values) creates a csv file containing the data (e.g. lastname, firstname, age).
- The file path is provided by command line parameter
- several kinds of problems should be handled (clear error message, options to proceed):
- directory is not existing: ask if it should be created or script should terminate
- file name empty - put in interactively or terminate
- file already exists - overwrtite or terminate
- if the file path is already existing, the user is asked if the file should replaced or the script should terminate.
- The first line contains the column names, e.g. 'Last Name;First Name;Age'
- The script is able to gather an arbitrary number of person data records.
- End is indicated by a '#' as input for the first field (e.g. lastname)
- CSV file is a list of person records, one per line. the fields are separated.by ';' e.g.: Müller;Heinz;23
submitted by [comments]
SOCIAL SHARE CARD GENERATOR