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

Shell script to combine 2 files horizontally and vertically, Normal 0 ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Information hiding, Why is this correct/when is this the right ide

Why is this correct/when is this the right idea

Define reasons for using functions, Define Reasons for using Functions? ...

Define Reasons for using Functions? 1. Evade rewriting the same code over and over. 2. It is simpler to write programs and keep track of what they are doing. Codes are able t

Temperature Calculation system, Detailed Description: • The program will t...

Detailed Description: • The program will take temperature readings as input from user for specified number of consecutive days. • Program will store these temperature values into

Draw data structure and analyse on xml, The scenario As an XML expert y...

The scenario As an XML expert you are required to model a system for an online furniture shop. After an interview with the shop manager you have the following information: T

Real-time driver model , AMCC PowerPC 440 EPx Sequoia Evaluation Kit, Embed...

AMCC PowerPC 440 EPx Sequoia Evaluation Kit, Embedded Linux Development Kit (ELDK), and Xenomai A. Description of the Project The project's objective is to design a set of

Oracle , PLEASE HELP ME ORACLE PROGRAMING TRIGGER

PLEASE HELP ME ORACLE PROGRAMING TRIGGER

Online Business Systems, Task .Task 1 Database design This task will allow...

Task .Task 1 Database design This task will allow you to demonstrate the following Learning Outcomes (LOs): LO 2. Justify the design and development of the application and critica

#title Problem Statement, Please choose the best tutor to rewrite my assign...

Please choose the best tutor to rewrite my assignment Ticket ID # EM201713THA711DSTN.because insructor does not accept. Thank you

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