Computing.Net > Forums > Unix > Shell Scripting

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Shell Scripting

Reply to Message Icon

Name: bakibol
Date: September 30, 2009 at 22:06:53 Pacific
OS: UNIX
Product: Microsoft Windows powershell scripting guide
Subcategory: General
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: tvc
Date: October 23, 2009 at 09:10:30 Pacific
Reply:

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
fi

Something like that ;)


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Shell Scripting

Variables in Shell SCripting www.computing.net/answers/unix/variables-in-shell-scripting/6020.html

shell script to uninstall java www.computing.net/answers/unix/shell-script-to-uninstall-java-/5976.html

Unix SHELL SCRIPTS www.computing.net/answers/unix/unix-shell-scripts/4885.html