CS 140U Homework 6 ================== Term: XXXXXXXXXXSpring 2020 Instructions: XXXXXXXXXXCreate a document named "homework_6" in your home directory on Linux XXXXXXXXXXthat contains the answers to...

1 answer below »
assignment attached


CS 140U Homework 6 ================== Term: 202002 Spring 2020 Instructions: 1. Create a document named "homework_6" in your home directory on Linux that contains the answers to the questions below. 2. This homework assignment references chapters 1 through 4 of the text. 3. When you have completed your file (and entered all of your answers) email your homework_6 file to me (doug.jones) using the command: mailx -s"140u homework_6" -a homework_6 doug.jones < /dev/null also transfer your homework_6 file to your desktop and upload it to the desire2learn dropbox for this assignment. 4. this assignment is due no later than 11:30pm on friday, june 5th, 2020 your email must be received by that time. 5. be sure to clearly label each of your answers clearly so that i know what question is being addressed. questions: 1. write a bash script to display the arithmetic sum of the command line arguments. you may assume all arguments are digits. 2. write a bash script that accepts a file glob specification on the command line, and moves each of the matching files to the current user's login home directory. 3. write a bash script that accepts a file glob specification on the command line, and creates a tar archive file that contains the matching files. the tar archive file name should include the name of the current user and the date and time the archive file was made. 4. write a bash script that will kill all processes owned by the current user, except for those processes that are ancestors of the process that is executing script. 5. write a bash script that will accept a list of user names on the command line, and for each user in the list report if the user is logged in (or not). 6. write a bash script that will accept a file glob specification on the command line, and report if all files have the same inode number. 7. write a bash script that will accept a file name on the command line, and then list the names (and full path) of all files with the same inode number. do not display any error messages or other information - just display the names and full path of the matches. 8. write a bash script that will accept the name of a text file on the command line, and then display the number of digits (0 - 9) found in the contents of the file. do not use sed, grep, awk, or vim. 9. write a bash script that will accept the name of a text file on the command line, and then remove all blank lines from the file. do not use sed, grep, awk, or vim. you may create temporary files if you wish. 10. write a bash script that will accept the name of a text file on the command line, and then remove all lines that begin with a vowel (a, e, i, o, u). do not use sed, grep, awk, or vim. you may create temporary files if you wish. dev/null="" also="" transfer="" your="" homework_6="" file="" to="" your="" desktop="" and="" upload="" it="" to="" the="" desire2learn="" dropbox="" for="" this="" assignment.="" 4.="" this="" assignment="" is="" due="" no="" later="" than="" 11:30pm="" on="" friday,="" june="" 5th,="" 2020="" your="" email="" must="" be="" received="" by="" that="" time.="" 5.="" be="" sure="" to="" clearly="" label="" each="" of="" your="" answers="" clearly="" so="" that="" i="" know="" what="" question="" is="" being="" addressed.="" questions:="" 1.="" write="" a="" bash="" script="" to="" display="" the="" arithmetic="" sum="" of="" the="" command="" line="" arguments.="" you="" may="" assume="" all="" arguments="" are="" digits.="" 2.="" write="" a="" bash="" script="" that="" accepts="" a="" file="" glob="" specification="" on="" the="" command="" line,="" and="" moves="" each="" of="" the="" matching="" files="" to="" the="" current="" user's="" login="" home="" directory.="" 3.="" write="" a="" bash="" script="" that="" accepts="" a="" file="" glob="" specification="" on="" the="" command="" line,="" and="" creates="" a="" tar="" archive="" file="" that="" contains="" the="" matching="" files.="" the="" tar="" archive="" file="" name="" should="" include="" the="" name="" of="" the="" current="" user="" and="" the="" date="" and="" time="" the="" archive="" file="" was="" made.="" 4.="" write="" a="" bash="" script="" that="" will="" kill="" all="" processes="" owned="" by="" the="" current="" user,="" except="" for="" those="" processes="" that="" are="" ancestors="" of="" the="" process="" that="" is="" executing="" script.="" 5.="" write="" a="" bash="" script="" that="" will="" accept="" a="" list="" of="" user="" names="" on="" the="" command="" line,="" and="" for="" each="" user="" in="" the="" list="" report="" if="" the="" user="" is="" logged="" in="" (or="" not).="" 6.="" write="" a="" bash="" script="" that="" will="" accept="" a="" file="" glob="" specification="" on="" the="" command="" line,="" and="" report="" if="" all="" files="" have="" the="" same="" inode="" number.="" 7.="" write="" a="" bash="" script="" that="" will="" accept="" a="" file="" name="" on="" the="" command="" line,="" and="" then="" list="" the="" names="" (and="" full="" path)="" of="" all="" files="" with="" the="" same="" inode="" number.="" do="" not="" display="" any="" error="" messages="" or="" other="" information="" -="" just="" display="" the="" names="" and="" full="" path="" of="" the="" matches.="" 8.="" write="" a="" bash="" script="" that="" will="" accept="" the="" name="" of="" a="" text="" file="" on="" the="" command="" line,="" and="" then="" display="" the="" number="" of="" digits="" (0="" -="" 9)="" found="" in="" the="" contents="" of="" the="" file.="" do="" not="" use="" sed,="" grep,="" awk,="" or="" vim.="" 9.="" write="" a="" bash="" script="" that="" will="" accept="" the="" name="" of="" a="" text="" file="" on="" the="" command="" line,="" and="" then="" remove="" all="" blank="" lines="" from="" the="" file.="" do="" not="" use="" sed,="" grep,="" awk,="" or="" vim.="" you="" may="" create="" temporary="" files="" if="" you="" wish.="" 10.="" write="" a="" bash="" script="" that="" will="" accept="" the="" name="" of="" a="" text="" file="" on="" the="" command="" line,="" and="" then="" remove="" all="" lines="" that="" begin="" with="" a="" vowel="" (a,="" e,="" i,="" o,="" u).="" do="" not="" use="" sed,="" grep,="" awk,="" or="" vim.="" you="" may="" create="" temporary="" files="" if="" you="">
Answered Same DayMay 27, 2021

Answer To: CS 140U Homework 6 ================== Term: XXXXXXXXXXSpring 2020 Instructions: XXXXXXXXXXCreate a...

Sandeep Kumar answered on May 31 2021
152 Votes
4.sh#!/bin/bash
pkill -u $USER
5.sh#!/bin/bash
read -p 'Enter username to check: ' user
if who -
u | grep -q "^$user "; then
top -u "$user"
else
echo "User $user is not logged in"
fi
6.sh#!/bin/bash
stat -c '%i' * > ino
#sort ino | uniq -c
uniq -d ino
7.sh
#!/bin/bash
read -p...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here