Sponsored Content
Top Forums Shell Programming and Scripting Problem in understanding debugging Post 302769060 by elixir_sinari on Monday 11th of February 2013 06:18:02 AM
Old 02-11-2013
That's two semi-colons and not colons.

Because that's the syntax for terminating a block of case statements. The first semi-colon ends that particular statement and the second ends the whole case block. The second one ensures that you don't try the following case blocks.

It is also possible to try the following block/s if you replace the second semi-colon with an ampersand (I think that's called a fall-through).
Code:
var='THE UNIX AND LINUX FORUMS';

case "$var" in

 *UNIX*)   echo "Has UNIX";&

 *LINUX*)  echo "Has LINUX";;

 *FORUMS*) echo "HAS FORUMS";;

esac

produces
Code:
Has UNIX
Has LINUX

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

egrep understanding problem

Hi, Can anyone please let me know the meaning of this line,i am not able to understand the egrep part(egrep '^{1,2}).This will search for this combination in beginning but what does the values in {}signifies here. /bin/echo $WhenToRun | egrep '^{1,2}:$' >/dev/null (1 Reply)
Discussion started by: namishtiwari
1 Replies

2. Solaris

debugging problem

OS : SOLARIS 10 debug tool :$gdb -v GNU gdb 6.6 compiler : $gcc -v gcc version 2.95.3 20010315 (release) When i tried to debug my application i got the following error. $gdb Pal GNU gdb 6.6 Copyright (C) 2006 Free Software Foundation, Inc. This GDB was... (2 Replies)
Discussion started by: satish@123
2 Replies

3. Shell Programming and Scripting

Problem with the shell script for understanding

Can Anybody please tell me the meaning of the script: #!/bin/sh str=$@ echo $str | sed 's/.*\\//' exit 0 (6 Replies)
Discussion started by: nixhead
6 Replies

4. UNIX for Dummies Questions & Answers

Problem understanding Paths

If I don't explain my issue well enough, I apologize ahead of time, extreme newbie here to scripting. I'm currently learning scripting from books and have moved on to the text Wicked Cool Shell Scripts by Dave Taylor, but there are still basic concepts that I'm having trouble understanding. ... (10 Replies)
Discussion started by: Chasman78
10 Replies

5. Shell Programming and Scripting

Problem in understanding export uses

i am beginner in shell scripting. not able to understand what below line will do. PS1=${HOST:=Žuname -nŽ}"$ " ; export PS1 HOST below is the script #!/bin/hash PS1=${HOST:=Žuname -nŽ}"$ " ; export PS1 HOST ; echo $PS1 and i getting the below output Žuname -nŽ$ (25 Replies)
Discussion started by: scriptor
25 Replies

6. UNIX for Dummies Questions & Answers

GDB Debugging Problem

I have added some code in my file. I have created executable rpm file of our code and also I have created debuginfo and debugsource files and installed all three. But when I debug in gdb I see the the code changes in soucre file. But the break point does not hit at that place as if it did not... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

7. Shell Programming and Scripting

Debugging mysterious perl script problem

the attached perl script is a deamon that, once kicked off from the command line, it runs in the background and waits for the master server to tell it what plugins to run. the script works well. but the problem is, whenever i start it, after about a few seconds of starting it, i start getting... (4 Replies)
Discussion started by: SkySmart
4 Replies

8. Programming

Best reference for understanding core file and debugging for different architectures

Hi , could someone suggest best reference for core file understanding , analysis , debugging for different architectures like what registers represent what in a architecture specific core .. how to get maximum information out of corrupted core different tools and how they work and how to... (1 Reply)
Discussion started by: Gopi Krishna P
1 Replies

9. Shell Programming and Scripting

Problem with (Understanding) function

I have this code #!/bin/bash LZ () { RETVAL="\n$(date +%Y-%m-%d_%H-%M-%S) --- " return RETVAL } echo -e $LZ"Test" sleep 3 echo -e $LZ"Test" which I want to use to make logentrys on my NAS. I expect of this code that there would be output like 2017-03-07_11-00-00 --- Test (4 Replies)
Discussion started by: matrois
4 Replies
Regexp::Common::URI::ftp(3)				User Contributed Perl Documentation			       Regexp::Common::URI::ftp(3)

NAME
Regexp::Common::URI::ftp -- Returns a pattern for FTP URIs. SYNOPSIS
use Regexp::Common qw /URI/; while (<>) { /$RE{URI}{FTP}/ and print "Contains an FTP URI. "; } DESCRIPTION
$RE{URI}{FTP}{-type}{-password}; Returns a regex for FTP URIs. Note: FTP URIs are not formally defined. RFC 1738 defines FTP URLs, but parts of that RFC have been obsoleted by RFC 2396. However, the differences between RFC 1738 and RFC 2396 are such that they aren't applicable straightforwardly to FTP URIs. There are two main problems: Passwords. RFC 1738 allowed an optional username and an optional password (separated by a colon) in the FTP URL. Hence, colons were not allowed in either the username or the password. RFC 2396 strongly recommends passwords should not be used in URIs. It does allow for userinfo instead. This userinfo part may contain colons, and hence contain more than one colon. The regexp returned follows the RFC 2396 specification, unless the {-password} option is given; then the regex allows for an optional username and password, separated by a colon. The ;type specifier. RFC 1738 does not allow semi-colons in FTP path names, because a semi-colon is a reserved character for FTP URIs. The semi-colon is used to separate the path from the option type specifier. However, in RFC 2396, paths consist of slash separated segments, and each segment is a semi-colon separated group of parameters. Straigthforward application of RFC 2396 would mean that a trailing type specifier couldn't be distinguished from the last segment of the path having a two parameters, the last one starting with type=. Therefore we have opted to disallow a semi-colon in the path part of an FTP URI. Furthermore, RFC 1738 allows three values for the type specifier, A, I and D (either upper case or lower case). However, the internet draft about FTP URIs [DRAFT-FTP-URL] (which expired in May 1997) notes the lack of consistent implementation of the D parameter and drops D from the set of possible values. We follow this practise; however, RFC 1738 behaviour can be archieved by using the -type = "[ADIadi]"> parameter. FTP URIs have the following syntax: "ftp:" "//" [ userinfo "@" ] host [ ":" port ] [ "/" path [ ";type=" value ]] When using {-password}, we have the syntax: "ftp:" "//" [ user [ ":" password ] "@" ] host [ ":" port ] [ "/" path [ ";type=" value ]] Under "{-keep}", the following are returned: $1 The complete URI. $2 The scheme. $3 The userinfo, or if {-password} is used, the username. $4 If {-password} is used, the password, else "undef". $5 The hostname or IP address. $6 The port number. $7 The full path and type specification, including the leading slash. $8 The full path and type specification, without the leading slash. $9 The full path, without the type specification nor the leading slash. $10 The value of the type specification. REFERENCES
[DRAFT-URL-FTP] Casey, James: A FTP URL Format. November 1996. [RFC 1738] Berners-Lee, Tim, Masinter, L., McCahill, M.: Uniform Resource Locators (URL). December 1994. [RFC 2396] Berners-Lee, Tim, Fielding, R., and Masinter, L.: Uniform Resource Identifiers (URI): Generic Syntax. August 1998. SEE ALSO
Regexp::Common::URI for other supported URIs. AUTHOR
Damian Conway (damian@conway.org) MAINTAINANCE
This package is maintained by Abigail (regexp-common@abigail.be). BUGS AND IRRITATIONS
Bound to be plenty. LICENSE and COPYRIGHT This software is Copyright (c) 2001 - 2009, Damian Conway and Abigail. This module is free software, and maybe used under any of the following licenses: 1) The Perl Artistic License. See the file COPYRIGHT.AL. 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2. 3) The BSD Licence. See the file COPYRIGHT.BSD. 4) The MIT Licence. See the file COPYRIGHT.MIT. perl v5.18.2 2013-03-08 Regexp::Common::URI::ftp(3)
All times are GMT -4. The time now is 11:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy