Sponsored Content
Full Discussion: multiple case
Top Forums Shell Programming and Scripting multiple case Post 17312 by PxT on Wednesday 13th of March 2002 11:52:01 AM
Old 03-13-2002
Please see the tcsh man page. Excerpt:

Quote:
switch (string)
case str1:
...
breaksw
...
default:
...
breaksw
endsw

Each case label is successively matched, against the specified string which is
first command and filename expanded. The file metacharacters `*', `?' and
`[...]' may be used in the case labels, which are variable expanded. If none of
the labels match before a `default' label is found, then the execution begins
after the default label. Each case label and the default label must appear at
the beginning of a line. The command breaksw causes execution to continue after
the endsw. Otherwise control may fall through case labels and default labels as
in C. If no label matches and there is no default, execution continues after the
endsw.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

lower case to upper case string conversion in shell script

How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies

2. Shell Programming and Scripting

How do I make multiple connections to the server in this case

Given the following code #!/usr/bin/perl -w use IO::Socket; my($handle, $line, $kidpid); $handle = IO::Socket::INET->new( PeerAddr =>"64.22.229.139", PeerPort =>"4321", Proto=>"tcp", ... (0 Replies)
Discussion started by: frequency8
0 Replies

3. Shell Programming and Scripting

Script needed to select and delete lower case and mixed case records

HELLO ALL, URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE. FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY and the CITY column records will be: Newyork washington ... (1 Reply)
Discussion started by: abhilash mn
1 Replies

4. Shell Programming and Scripting

multiple lines inside a case statement

echo "please enter ur choice.. 1. Make a file. 2. Display contents 3. Copy the file 4. Rename the file 5. Delete the file 6. Exit" read choice case $choice in 1 ) echo enter the file name read fname if then echo... (2 Replies)
Discussion started by: gotam
2 Replies

5. Shell Programming and Scripting

Renaming multiple files, specifically changing their case

Hey all, I'm running a BASH shell and I was wondering if anyone knows a code to rename all the files in a directory. All I need to do is change the first character in the file from uppercase to lowercase and some of the files are already lowercase so they don't need to change. -Thanks (4 Replies)
Discussion started by: jjzieve
4 Replies

6. Shell Programming and Scripting

Multiple conditions in a CASE statement

is it possible to use multiple conditions in a CASE statement? And if so, what is the syntax? I'm trying to use one but can't seem to get it right. I want the statement to be CASE $vendor OR $alias condition 1) statements; condition 2) statements; etc. esac but I keep... (25 Replies)
Discussion started by: Straitsfan
25 Replies

7. Shell Programming and Scripting

multiple looping with case and funtion showing error, Please help

Hello All, I have code as follows :- while true do {opening a case1 statement} 1) {opening another case2 statement} {closing case 2} 2) Showing error for "2)" as Syntax error at line 59 : `)' is not expected. *) {closing case 1} ... (5 Replies)
Discussion started by: Renjesh
5 Replies

8. Shell Programming and Scripting

Choose multiple conditions in case?

Hi all, I am attempting to create a shell script to optimize some routine process. I want this script can let user select the actions they want to do. But I met a problem that my script can only read one input and then do one action. Is it possible to let my script to run more than one... (2 Replies)
Discussion started by: kaiya
2 Replies

9. Programming

Size of derived class, in case of multiple inheritance

Why, here the size of class 'Derived' is 8 ? class Base1 { public: virtual void f() { } }; class Base2 { public: virtual void f() { } }; class Derived : public Base1, Base2 { public: virtual void f() { } }; (1 Reply)
Discussion started by: techmonk
1 Replies
E2LABEL(8)                                                    System Manager's Manual                                                   E2LABEL(8)

NAME
e2label - Change the label on an ext2/ext3/ext4 filesystem SYNOPSIS
e2label device [ volume-label ] DESCRIPTION
e2label will display or change the volume label on the ext2, ext3, or ext4 filesystem located on device. If the optional argument volume-label is not present, e2label will simply display the current volume label. If the optional argument volume-label is present, then e2label will set the volume label to be volume-label. Ext2 volume labels can be at most 16 characters long; if volume-label is longer than 16 characters, e2label will truncate it and print a warning message. It is also possible to set the volume label using the -L option of tune2fs(8). AUTHOR
e2label was written by Theodore Ts'o (tytso@mit.edu). AVAILABILITY
e2label is part of the e2fsprogs package and is available from http://e2fsprogs.sourceforge.net. SEE ALSO
mke2fs(8), tune2fs(8) E2fsprogs version 1.44.1 March 2018 E2LABEL(8)
All times are GMT -4. The time now is 08:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy