Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Write a shell script file called letter1. After running the script, it will prompt the user, for an English alphabet, confirm the alphabet chosen, and then search the current directory for all the files having that alphabet as its first letter in its file-name. Show the list of matching files on your screen.

Is this your homework ?
read firstletter
ls -1 ${firstletter}*This will not check if the input given is 1 digit, or even a character, but something like
if [ ! "$firstletter" = "[a-z]" ]
then
exit 1
fiSomething like that ;)

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |