![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux Replicated High Availability Manager 1.4.2 (DRBD 8.2 based branch) | iBot | Software Releases - RSS News | 0 | 04-15-2008 03:00 PM |
| case statement | bkan77 | Shell Programming and Scripting | 5 | 09-11-2007 06:54 PM |
| How can I get an if statement to execute based on number of lines in a file? | LordJezo | Shell Programming and Scripting | 6 | 05-14-2004 11:50 AM |
| Case Statement | Zeta_Acosta | Shell Programming and Scripting | 19 | 04-06-2004 05:16 PM |
| case statement | Bab00shka | Shell Programming and Scripting | 1 | 07-15-2002 06:31 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
case statement based on file availability
I need to make a select menu that gives options dynamically based on whether certain files are available. For instance:
PS3="Open which readme? " select readme in This That do case "$readme" in This) open -a /Applications/TextEdit.app This.txt;; That) open -a /Applications/TextEdit.app That.txt;; * ) echo "Invalid selection";; esac done } The catch is that if the file doesn't exist, it should not show in the menu, either. I'm fairly new to shell scripting, so any help would be appreciated. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|