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

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

Posted Date: 9/26/2012 6:34:30 AM | Location : United States







Related Discussions:- Display & list directory contents,make & change directory, Assignment Help, Ask Question on Display & list directory contents,make & change directory, Get Answer, Expert's Help, Display & list directory contents,make & change directory Discussions

Write discussion on Display & list directory contents,make & change directory
Your posts are moderated
Related Questions
Define the The if statement - Computer Programming? The if statement is an influential selection statement and is used to control the flow of execution of statements. One of th

Question 1: a) Assume that B is an array of 50 words; write a code which will place the smallest integer of array B in register AX. b) Write a small code (only three instr

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

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 (

This is Python program I am stuck Modify the Russian peasant multiplication mod n function from class to perform "Russian peasant exponentiation" instead. You can assume that you

Define the Control statements in Computer Programming? The statements are part of the program that performs some action. The compiler will check a program sequentially from the

In combat simulation software, exploding land mines cause damage to military vehicles. In addition to the damage done to the vehicles themselves, we are interested in the number of

I am building wpf application and i want to install this application on a server pc and share it to other pces on a net work , my question is i have static class that contain data

Question: (a)  An HTML file "decor.html" uses an external Cascading Style Sheet file name  "nicedesign.css". Users are viewing the Web page making use of different kinds of  br

We need help for build a Price Quote Generator I am interested in two things (A) a web based system that will allow a user to enter the parameters of their contests (there are o