Sponsored Content
Top Forums UNIX for Dummies Questions & Answers case statement in UNIX scripting (ksh) Post 302293312 by fpmurphy on Monday 2nd of March 2009 11:55:39 PM
Old 03-03-2009
Code:
read alld?"Do you want to export all docs [yes or no]? "

read temr?"Do you want to export template or report only [yes or no]? "

if [ $alld = "yes" -a $temr = "yes" ]
then
    echo "yes yes"
elif [ $alld = "no" -a $temr = "yes" ]
then
    echo "no yes"
elif [ $alld = "no" -a $temr = "no" ]
then
    echo "no no"
else
    echo "$alld $temr"
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh case statement

I am trying to write a ksh script using the case statement to select certain directories to remove. The directories that I am looking for are in the following format 2008-10-10. I want to exclude all other files/directories that contain anything other the 4 digit year,a dash, 2 digit month, a... (2 Replies)
Discussion started by: dgilc
2 Replies

2. Shell Programming and Scripting

ksh "case" statement question

Hi I have the following case statement: case $larg in *_* ) a=${larg%_*}; b=${larg#*_}; ;; *^* ) a=${larg%^*}; b=${larg#*^}; ;; esac I cannot figure out what *_* and *^* stand for... Also what a=${larg%_*}; b=${larg#*_}; and a=${larg%^*}; b=${larg#*^}; ... (1 Reply)
Discussion started by: aoussenko
1 Replies

3. Shell Programming and Scripting

Using an array with a case statement in KSH

Hi, I'm really new ro shell scripting (actually any kind of programming) and am pretty sure I'm making a pretty basic error here but I can't for the life of me figure it out. What I'm trying to do is get an array working with a case statement in a KSH script. The code is as follows: ... (3 Replies)
Discussion started by: SReilly
3 Replies

4. Shell Programming and Scripting

!!VERY URGENT!! Trouble in getting user input, while using under CASE statement in UNIX

i want to get user input like this please tell which option to chose 1. mango 2. tango 3. rango if user chooses mango then it should execute a set of statements and again ask like this what do you want to do 1.add 2.subtract 3.exit when i choose exit it should goto my previous... (1 Reply)
Discussion started by: s.deepak
1 Replies

5. Shell Programming and Scripting

Trouble in getting user input while using CASE statement in UNIX

i want to get user input like this please tell which option to chose 1. mango 2. tango 3. rango if user chooses mango then it should execute a set of statements and again ask like this what do you want to do 1.add 2.subtract 3.exit when i choose exit it should goto my previous menu... (4 Replies)
Discussion started by: s.deepak
4 Replies

6. Shell Programming and Scripting

Use case insensitive variable in ksh shell scripting using sed or awk

I am using a variable called $variable in a pattern search to print from a starting variable to a constant value. the variable search should be case in sensitive. i tired using Ip at the end in the below command. but in ksh it is not working. sed -n "/$variable/,/constant/p" file i also... (11 Replies)
Discussion started by: johnjs
11 Replies

7. Shell Programming and Scripting

Menu and case statement scripting

hi all i am trying to get help with writing a script using case statement to display menu as 1) Authentication log 2) System log 3) Messages 4) Dmesg 5) Boot log Q) Exit When selecting the menu by 1 or 2 or 3 o 4 or 5, it should display the last 10 lines of the log files, if... (3 Replies)
Discussion started by: renegade11
3 Replies

8. Shell Programming and Scripting

Case statement in UNIX shell script

have written the below code to check whether the string received from user is a file name or dir using case statement, but its going into default case*). #!/bin/sh #Get a string from user and check whether its a existing filename or not rm str2 rm str3 echo "enter a file \c" read fil... (8 Replies)
Discussion started by: Mohan0509
8 Replies

9. Shell Programming and Scripting

ksh case statement issue

Hi. I wrote the following case statement to replace a series of 'ELIF' statements as it looks better and is easier to maintain. However, for some reason the commands don't fully work in this format. Take option 1. It should call a script that runs in the background but it doesn't work. Can anyone... (3 Replies)
Discussion started by: user052009
3 Replies

10. Shell Programming and Scripting

Shell scripting with case statement

Foe example we have three environments int,qa and prod.Each environment has some number of servers. int=Server1,Server2,Server3 qa=Server4,Server5,Server6 prod=Server7,Server8,Server9 echo "Enter the Environment i.e int,qa,prod" read env case $env in int) ## Need command where all the... (9 Replies)
Discussion started by: nareshreddy443
9 Replies
LOCALE_GET_DISPLAY_NAME(3)						 1						LOCALE_GET_DISPLAY_NAME(3)

Locale::getDisplayName - Returns an appropriately localized display name for the input locale

	Object oriented style

SYNOPSIS
publicstatic string Locale::getDisplayName (string $locale, [string $in_locale]) DESCRIPTION
Procedural style string locale_get_display_name (string $locale, [string $in_locale]) Returns an appropriately localized display name for the input locale. If is NULL then the default locale is used. PARAMETERS
o $locale - The locale to return a display name for. o $in_locale -optional format locale RETURN VALUES
Display name of the locale in the format appropriate for $in_locale. EXAMPLES
Example #1 locale_get_display_name(3) example <?php echo locale_get_display_name('sl-Latn-IT-nedis', 'en'); echo "; "; echo locale_get_display_name('sl-Latn-IT-nedis', 'fr'); echo "; "; echo locale_get_display_name('sl-Latn-IT-nedis', 'de'); ?> Example #2 OO example <?php echo Locale::getDisplayName('sl-Latn-IT-nedis', 'en'); echo "; "; echo Locale::getDisplayName('sl-Latn-IT-nedis', 'fr'); echo "; "; echo Locale::getDisplayName('sl-Latn-IT-nedis', 'de'); ?> The above example will output: Slovenian (Latin, Italy, Natisone dialect); slovxc3xa8ne (latin, Italie, dialecte de Natisone; Slowenisch (Lateinisch, Italien, NEDIS) SEE ALSO
locale_get_display_language(3), locale_get_display_script(3), locale_get_display_region(3), locale_get_display_variant(3). PHP Documentation Group LOCALE_GET_DISPLAY_NAME(3)
All times are GMT -4. The time now is 07:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy