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

Write a booking and pricing system, Write a booking and pricing system for ...

Write a booking and pricing system for seats for performances in a theatre. Design and write a system to handle information (equipment, people, events etc.) for a club. Given

shell script to check that a given number is prime or not, Normal 0 ...

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

List recursion to de ne the function, Use list recursion to de ne the funct...

Use list recursion to de ne the function mySum which takes as input an integer and a list of integers and returns the list obtained by adding every element of the list by the rst

Program to create multithreaded calculator, Multithreaded Calculator I...

Multithreaded Calculator In this Lab, you will be implementing a simple multithreaded calculator. Our calculator will accept expressions as infix notation text strings consist

Need help starting a project out, I''m doing a project for class in college...

I''m doing a project for class in college and im supposed to use today''s date and figure out how old i am in months, days, minutes, and seconds. My question is what is the beset

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

Programs for shell scripts, 1. Write a bash shell script which searches thr...

1. Write a bash shell script which searches through your folders for files with the extension *.tex, and then interactively deletes the corresponding *.aux, *.dvi and *.log files (

Java string handling, Expertsmind brings you unique solution in java assig...

Expertsmind brings you unique solution in java assignments String Handling Series signifies a sequence of character types. It has set duration of personality sequence. Onc

Provide example of function, Provide Example of Function? An illustrati...

Provide Example of Function? An illustration of a function definition main() { message(); } /* header */ message() { /*bodystarts here*/ printf ("Example for function

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