Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Revision Question 3 on Linux. Please explain the shell script commands in the context of post execution. You have just logged in and have a

Revision Question 3 on Linux. Please explain the shell script commands in the context of post execution.

You have just logged in and have a directory called "novel" in your home directory containing the following files:

chapter1.docx chapter2.docx chapter3.docx draft.pdf save

where "save" is itself a directory and contains the files

Attributes.txt draft.pdf.1 draft.pdf.2 draft.pdf.3 indexA.txt indexB.txt list1.txt list2.txt

a) Describe the results you would expect when executing the following shell commands:

i) ls novel/save/*A*

ii) ls novel/*r[23]*

iii) rmdir novel

iv) ls novel | wc -l

v) rm -r novel/save

(assume each command is run when the directory "novel" is as described above)

b) Consider the following short shell script

#!/bin/sh

cd $1

cnt = ` ls save/$2* | wc -l`

for i in $2*

do

cnt=$((cnt+1))

cp $i save/$i$cnt

done

If this script is stored in a file called arch, what would be the effect of running this shell command:

./arch novel draft

c) Describe the underlying design principle behind the Linux command set - often called the "UNIX philosophy".

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions