Write a script which reads a text file and output key attribute of file
Write a script which reads a text file and output the following
1). Count
of character, words and lines.
2). File
in reverse.
3). Frequency
of particular word in the file.
4). Lower
case letter in place of upper case letter.
File Name : ex15.sh
echo
"Enter File Name \c"
read
fname
choice=y
while
[ "$choice" = "y" ]
do
echo
" ------------------------------------"
echo " 1. Count character,words and lines"
echo " 2. Reverse File"
echo " 3. Found frequency of word"
echo " 4. Convert upper to lower"
echo " 5. Convert lower to upper"
echo " 6. Exit
echo " ------------------------------------"
echo
"Enter Choice: \c"
read
ch
case
$ch in
1)
echo "Total Characters:\c"
wc -c $fname
echo "Total Words:\c"
wc -w $fname
echo "Total Lines:\c"
wc -l $fname
;;
2)
rev $fname
;;
3)
echo "Find your word :\c"
read w
echo "Frequency:\c"
grep
-c "$w" $fname
;;
4)
echo "Enter Text : \c"
read text
echo $text | tr "[A-Z]"
"[a-z]"
;;
5)
echo "Enter Text : \c"
read text
echo $text | tr "[a-z]"
"[A-Z]"
;;
6) 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)
- CSS (3)
- Configure Tomcat7 (2)
- Decryption (16)
- Difference (1)
- Encryption (16)
- Error Detection and Correction Techniques (3)
- FON (27)
- Framing Technic (2)
- J2EE (29)
- JAVA (13)
- JavaScript (19)
- OS (17)
- PHP (11)
- Protocol (3)
- SERVER SOCKET PROGRAMING (7)
- Servlet (13)
- WTAD (34)
- c (11)
- install Tomcat (2)
- linux (8)
- shell script (33)
- unix (22)
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