Sponsored Content
Full Discussion: What is #0 ?
Top Forums Shell Programming and Scripting What is #0 ? Post 302403133 by vgersh99 on Thursday 11th of March 2010 02:06:54 PM
Old 03-11-2010
Code:
$ a='00abc'
$ echo ${a#0}
0abc

man ksh yields the following:
Code:
     The following four varieties of parameter expansion  provide
     for  substring  processing.  In  each case, pattern matching
     notation (see patmat), rather than regular expression  nota-
     tion, will be used to evaluate the patterns. If parameter is
     * or @, then all the positional  parameters,  starting  with
     $1,  are substituted (separated by a field separator charac-
     ter). Enclosing  the  full  parameter  expansion  string  in
     double-quotes will not cause the following four varieties of
     pattern characters to be quoted, whereas quoting  characters
     within the braces will have this effect.

     ${parameter%word}
           Remove Smallest  Suffix  Pattern.  The  word  will  be
           expanded to produce a pattern. The parameter expansion
           then will result in parameter, with the smallest  por-
           tion of the suffix matched by the pattern deleted.

     ${parameter%%word}
           Remove  Largest  Suffix  Pattern.  The  word  will  be
           expanded to produce a pattern. The parameter expansion
           then will result in parameter, with the  largest  por-
           tion of the suffix matched by the pattern deleted.

     ${parameter#word}
           Remove Smallest  Prefix  Pattern.  The  word  will  be
           expanded to produce a pattern. The parameter expansion
           then will result in parameter, with the smallest  por-
           tion of the prefix matched by the pattern deleted.

     ${parameter##word}
           Remove  Largest  Prefix  Pattern.  The  word  will  be
           expanded to produce a pattern. The parameter expansion
           then will result in parameter, with the  largest  por-
           tion of the prefix matched by the pattern deleted.


Last edited by Neo; 03-11-2010 at 03:32 PM.. Reason: added bb code tags for man
 
suspend(1)							   User Commands							suspend(1)

NAME
suspend - shell built-in function to halt the current shell SYNOPSIS
sh suspend csh suspend ksh suspend DESCRIPTION
sh Stops the execution of the current shell (but not if it is the login shell). csh Stop the shell in its tracks, much as if it had been sent a stop signal with ^Z. This is most often used to stop shells started by su. ksh Stops the execution of the current shell (but not if it is the login shell). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), kill(1), ksh(1), sh(1), su(1M), attributes(5) SunOS 5.10 15 Apr 1994 suspend(1)
All times are GMT -4. The time now is 12:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy