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

Linux commans, Corrected Exercise #1: 1. Explain the following unexpected r...

Corrected Exercise #1: 1. Explain the following unexpected result: why did you get the system date command instead of the script? $ whereis date date: /bin/date ... $ echo $PATH

What is the purpose of a hashtable, Question: (a) How do you implement...

Question: (a) How do you implement the following in ASP.NET: (i) Server-side Comments (ii) Server-side Include Directives. (b) What is the purpose of a HashTable? (

Explain the use of sync and fsck, Problem 1 Define the architecture of ...

Problem 1 Define the architecture of UNIX operating system with appropriate diagram Problem 2 Define the term inter-process communication. What are several approaches t

Hb programming test, The purpose of the HB Programming test is to assess wh...

The purpose of the HB Programming test is to assess whether a candidate has sufficient knowledge to join our team here and beyond that where they would fit within our teams. The

Implement a two-dimensional table in prolog, Implement a two-dimensional ta...

Implement a two-dimensional table in Prolog. Your program will contain: An insert_entry predicate that takes a table, row, column and an entry and inserts the entry at the g

Understanding the html document object model, At the core of DHTML is the D...

At the core of DHTML is the Document Object Model, or DOM, which represents the HTML or XML of a Web page that is displayed in a browser. The Document Object Model that represents

Program to compute mixing ratio, Write a program to compute: 1.)    Mixi...

Write a program to compute: 1.)    Mixing ratio, W=.622[Vapor pressure/(pressure-vapor pressure)] 2.)    Virtual temperature, VT=T(1+0.61 mixing ratio) = T(1+.61W) 3.)

Mvc framework, MVC Framework The ASP.NET MVC Structure is a web program fra...

MVC Framework The ASP.NET MVC Structure is a web program framework that tools the model-view-controller (MVC) design. According to ASP.NET, it allows application designers to devel

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