Answers
Hi,
Please find the below commands.
$ mkdir IFT383FinalExam
$ mkdir Activities
$ mkdir Activity1
Using the cat command, create a file named classRoster with the following fields
$ cat > classRoster
123,AA,BB,A+,CSE,DAN
456,DD,EE,B+,ECE,DOL
789,FF,GG,C+,ITI,DISK
Display file
$ cat classRoster
123,AA,BB,A+,CSE,DAN
456,DD,EE,B+,ECE,DOL
789,FF,GG,C+,ITI,DISK
Move the file classRoster to the directory Activity1.
$ mv classRoster ./IFT383FinalExam/Activities/Activity1
Go to the Activity1 directory.
$ cd ./IFT383FinalExam/Activities/Activity1
Display the directory you are in.
$ pwd
/IFT383FinalExam/Activities/Activity1
Add read, write and execute permissions for user and group to Activity1 directory.
$ chmod 775 Activity1
Create a new file called header using cat command with the following field names, separated by a tab.
$ cat > header
StudentID FirstName LastName Grade ProgramofStudy ASURITEID
Display the file.
$ cat header
StudentID FirstName LastName Grade ProgramofStudy ASURITEID
Copy the contents of header into classRoster, as the first line
$ head -1 header | cat > tmp && cat classRoster | cat >> tmp && mv tmp classRoster
$ rm tmp
Replace the comma with a tab using appropriate filters
$ cat classRoster | sed "s/,/ /g"
StudentID FirstName LastName Grade ProgramofStudy ASURITEID
123 AA BB A+ CSE DAN
456 DD EE B+ ECE DOL
789 FF GG C+ ITI DISK