Write a script to make following file and directory management operations
14. Write a script to make following file and directory management operations menu
based:
Display
current directory
List
directory
Make
directory
Change
directory
Copy
a file
Rename
a file
Delete
a file
Edit
a file
File Name : ex14.sh
clear
choice=y
while
[ "$choice" = "y" ]
do
echo "____________________________________"
echo
" MAIN MENU "
echo
"____________________________________"
echo
"1 - DISPLAY CURRENT DIRECTORY"
echo
"2 - LIST DIRECTORY"
echo
"3 - MAKE DIRECTORY"
echo
"4 - CHANGE DIRECTORY"
echo
"5 - COPY A FILE"
echo
"6 - RENAME A FILE"
echo
"7 - DELETE A FILE"
echo
"8 - EDIT A FILE"
echo
"9 - EXIT"
echo "____________________________________"
echo
"ENTER THE CHOICE :- "
read
choice
case
$choice in
1) pwd;;
2) ls
-l;;
3) echo "Enter Directory Name "
read dir_name
mkdir $dir_name
echo "[ $dir_name ]
Sucessfully Created Directory"
;;
4) echo
"Enter the Absolute Path to change the directory: "
read apath
cd $apath
echo "Working path
changed successfully!"
pwd
;;
5) echo
"Enter name of file: "
read filename
echo "Copy where?
"
read apath
cp $filename $apath
echo "File
$filename copied successfully to $apath"
;;
6) echo
"Enter Current File Name: "
read oname
echo "Enter New File Name: "
read nname
mv $oname $nname
;;
7) echo
"Enter file Name : "
read fdel
if
[ -f $fdel ]; then
rm -i $fdel
fi
;;
8) echo
"Enter filename to open it in Text Editor: "
read filename
cat $filename
cat >> $filename
#vi $filename
;;
9) exit
;;
*) echo
"Invalid Choice ....."
;;
esac
echo "Do u want to continue.....?
[ y / n ]"
read choice
case $choice in
Y|y) choice=y;;
N|n) choice=n;;
*) choice=y;;
esac
done
Subscribe to:
Post Comments (Atom)
Subjects
- WordPress
- Mobile Computing-4649303 Practical Solution
- Android Programming New Syllabus Theory
- PHP LAMP Question Bank
- PHP LAMP Theory
- Step by Step Android Example
- Android Practical
- Android Theory
- Android Question Bank
- Networking FON Practical
- Networking FON Theory
- OS Practical
- OS Theory
- HTML
- JavaScript
- J2EE WTAD Theory
- J2EE WTAD Question Bank
- J2EE WTAD Quick Guide
- J2EE WTAD GTU Papers
- J2EE WTAD Practical
- Python
- JAVA Theory
- JAVA Practical
- MIS
Categories
- Android (55)
- c (11)
- Configure Tomcat7 (2)
- CSS (3)
- Decryption (16)
- Difference (1)
- Encryption (16)
- Error Detection and Correction Techniques (3)
- FON (27)
- Framing Technic (2)
- install Tomcat (2)
- J2EE (29)
- JAVA (13)
- JavaScript (19)
- linux (8)
- OS (17)
- PHP (11)
- Protocol (3)
- SERVER SOCKET PROGRAMING (7)
- Servlet (13)
- shell script (33)
- unix (22)
- WTAD (34)
Blog Archive
-
▼
2012
(79)
-
▼
November
(15)
- unix grep command
- Write a script to learn command line argument
- Write a script to display the last modified file
- Write a script to display all lines of a file in a...
- Write a script to display all words of a file in a...
- Write a script to check whether a given number is ...
- Write a script to check whether a given string is ...
- Write a shell script to mathematics calculation
- Write a shell script to Perform Following String O...
- Write a Shell Script for Simple Database Managemen...
- Write a shell script to check whether the named us...
- Write a script which reads a text file and output ...
- Write a script to make following file and director...
- Write a shell script to add the statement #include...
- Write a script to implement the following commands...
-
▼
November
(15)
Total Pageviews
© BipinRupadiya.com. Powered by Blogger.
0 comments:
Post a Comment