Advertisement
phuongnx

C5_2

Jun 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.28 KB | None | 0 0
  1. #!/bin/bash
  2. count() {
  3.     if [ -f $1 ]
  4.     then {
  5.         echo "so dau cach: "
  6.         egrep -o " " $1 | wc -l
  7.         echo "so ky tu nguyen am: "
  8.         egrep -o "[aeiouy]" $1 | wc -l
  9.         echo "so dong"
  10.         wc -l $1
  11.     }
  12.     else {
  13.         echo 'file khong ton tai'
  14.     }
  15.     fi
  16. }
  17. echo 'nhap file: '
  18. read file
  19. count $file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement