56.5k views
0 votes
cd to the directory called final that is located within my home directory. While viewing the file called mypasswd you notice that all of the references to the user's shells, the C shell, were entered in upper-case letters. That is not correct. Create a sed command string that will convert ONLY the references to the user's shell CSH to csh within the file called mypasswd and save the output to a new file called newpasswd in your home directory. Be Careful. There are other refernces to CSH in the file. Which comand string will do this

1 Answer

4 votes

Answer:

sed 's/CSH$/csh/g' mypasswd > ~/newpasswd

Step-by-step explanation:

The SED is a stream editor, where s’ which substitutes the “csh” instead of word “CSH” in the file called mypasswd and save the output to the newpasswd. In the screenshot at the attached file shows the data of mypasswd and newpasswd files.

cd to the directory called final that is located within my home directory. While viewing-example-1
User Renaud Pacalet
by
6.1k points