Display & list directory contents,make & change directory, Programming Languages

Assignment Help:

W.A.S.S to perform the following operations depending upon the menu choice:

                              i.    Display current directory.

                            ii.    List directory contents.

                           iii.    Make a directory.

                           iv.    Change the directory.

                            v.    Rename a file.

                           vi.    Remove the file.

                         vii.    Edit a file.

 

Program

 

#W.A.S.S. to perform the operation like display current directory,make directory,change #directory, rename file, remove file,edit file

 

echo "a)Display current directory:"

echo "b)List directory contents:"

echo "c)Make a directory:"

echo "d)Change the directory:"

echo "e)Rename a file:"

echo "f)Remove a file:"

echo "g)Edit a file:"

echo -e "Enter your choice:\c"

read c

 

case $c in

a)echo -e "A present working directory is: \c"

   pwd

   ;;

 

b) ls

   ;;

 

c )echo -e "Enter a name of dir: \c"

    read dnm

    mkdir "$dnm"

    ;;

 

d)echo -e "Enter name of dir to change in: \c"

   read dnm

   cd "$dnm"

   ;;

 

 

 

e)echo -e "Enter name of dir to rename: \c"

   read dnm

   echo -e "Enter New name of dir: \c"

   read ndnm

   mv "$dnm" "$ndnm"

   ;;

 

f)echo -e "Enter name of file to remove; \c"

  read dnm

  rmdir "$dnm"

  ;;

 

g)echo -e "Enter name of file to edit: \c"

  read dnm

  vi "$dnm"

  ;;

esac

 

Output

 

a)Display current directory:

b)List directory contents:

c)Make a directory:

d)Change the directory:

e)Rename a file:

f)Remove a file:

g)Edit a file:

 

Enter your choice:a

A present working directory is: /root

 

Enter your choice:e

Enter name of dir to rename: temp.sh

Enter New name of dir: tempy.sh

 

Enter your choice:f

             Enter name of dir to remove; xyz


Related Discussions:- Display & list directory contents,make & change directory

Develop a program on behavior of hospital personnel, A psychologist is inte...

A psychologist is interested in learning about the voting behavior of college students.  (4 points for each part.)Design a study which would yield data on this topic. a. state y

Fileless document and encryption(stegnography), code for using tree view co...

code for using tree view control and fill it with database

.net windows services, .NET Windows Services But Enthusiasm has an amazi...

.NET Windows Services But Enthusiasm has an amazing record of beginning overdue but finding up easily. This is real in situation of .NET too. Enthusiasm put their best men at

Language-integrated query, Language-Integrated Query Language integrated qu...

Language-Integrated Query Language integrated query (LINQ, obvious "link") is a Enthusiasm .NET Structure element that contributes ancient data querying abilities to .NET dialects,

I have to create three batch files, I have to create a bank atm machine usi...

I have to create a bank atm machine using MS-DOS. I am struggling to create LIST ALL ACCOUNTS ROLL-BACK TRANSACTIONS ACCESS AN ACCOUNT

C-program, about how to create the program in c

about how to create the program in c

Java, How to run java program?

How to run java program?

What do you meant by a function, (a) (i) What do you meant  by a function? ...

(a) (i) What do you meant  by a function? Are functions required when writing a C program? (ii) State one of the advantages to the use of functions. (iii) What do you meant by a

What is an authentication subsystem, Question: (i) Each time a securit...

Question: (i) Each time a security mechanism is installed or deleted in a Digital UNIX system, SIA is involved. Draw a Security Integration Architecture diagram. (ii) How

Produce a hierarchy chart-a structured flowchart, Produce a hierarchy chart...

Produce a hierarchy chart, a structured flowchart, and a Pascal program (with appropriate comments) to generate the Sales Commission Report shown below. The commission for each sal

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd