Sponsored Content
Top Forums Shell Programming and Scripting Explaining behaviour of sudo bash "$0" "$@"; Post 303025461 by Corona688 on Friday 2nd of November 2018 04:12:18 PM
Old 11-02-2018
Those are round braces, not curly braces, and they create a sub-shell. Right now their only side-effect is wasting time and memory, but if you make a habit of that you'll discover that variable assignments and the like don't communicate outside them.

So they're not decorations and can cause problems if you make a habit of it.
This User Gave Thanks to Corona688 For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Solaris

The slices "usr", "opt", "tmp" disappeared!!! Help please.

The system don't boot. on the screen appears following: press enter to maintenance (or type CTRL-D to continue)...I checked with format command. ... the slices "0-root","1-swap","2-backup" exist. ...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies

5. UNIX for Dummies Questions & Answers

"Help with bash script" - "License Server and Patch Updates"

Hi All, I'm completely new to bash scripting and still learning my way through albeit vey slowly. I need to know where to insert my server names', my ip address numbers through out the script alas to no avail. I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
Discussion started by: profileuser
25 Replies

6. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

7. Shell Programming and Scripting

Expect: spawn id exp5 not open while executing "expect "$" { send "sudo su -\r" }"

Hi All, i am trying to ssh to a remote machine and execute certain command to remote machine through script. i am able to ssh but after its getting hung at the promt and after pressing ctrl +d i am gettin the out put as expect: spawn id exp5 not open while executing "expect "$" {... (3 Replies)
Discussion started by: Siddharth shivh
3 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
PPI::Structure(3)					User Contributed Perl Documentation					 PPI::Structure(3)

NAME
PPI::Structure - The base class for Perl braced structures INHERITANCE
PPI::Structure isa PPI::Node isa PPI::Element DESCRIPTION
PPI::Structure is the root class for all Perl bracing structures. This covers all forms of " [ ... ] ", " { ... } ", and " ( ... ) " brace types, and includes cases where only one half of the pair exist. The class PPI::Structure itself is full abstract and no objects of that type should actually exist in the tree. Elements vs Children A PPI::Structure has an unusual existance. Unlike a PPI::Document or PPI::Statement, which both simply contain other elements, a structure both contains and consists of content. That is, the brace tokens are not considered to be "children" of the structure, but are part of it. In practice, this will mean that while the ->elements and ->tokens methods (and related) will return a list with the brace tokens at either end, the ->children method explicitly will not return the brace. STRUCTURE CLASSES
Excluding the transient PPI::Structure::Unknown that exists briefly inside the parser, there are eight types of structure. PPI::Structure::List This covers all round braces used for function arguments, in "foreach" loops, literal lists, and braces used for precedence-ordering purposes. PPI::Structure::For Although not used for the "foreach" loop list, this is used for the special case of the round-brace three-part semicolon-seperated "for" loop expression (the traditional C style for loop). PPI::Structure::Given This is for the expression being matched in switch statements. PPI::Structure::When This is for the matching expression in "when" statements. PPI::Structure::Condition This round-brace structure covers boolean conditional braces, such as for "if" and "while" blocks. PPI::Structure::Block This curly-brace and common structure is used for all form of code blocks. This includes those for "if", "do" and similar, as well as "grep", "map", "sort", "sub" and (labelled or anonymous) scoping blocks. PPI::Structure::Constructor This class covers brace structures used for the construction of anonymous "ARRAY" and "HASH" references. PPI::Structure::Subscript This class covers square-braces and curly-braces used after a -> pointer to access the subscript of an "ARRAY" or "HASH". METHODS
"PPI::Structure" itself has very few methods. Most of the time, you will be working with the more generic PPI::Element or PPI::Node methods, or one of the methods that are subclass-specific. start For lack of better terminology (like "open" and "close") that has not already in use for some other more important purpose, the two individual braces for the structure are known within PPI as the "start" and "finish" braces (at least for method purposes). The "start" method returns the start brace for the structure (i.e. the opening brace). Returns the brace as a PPI::Token::Structure or "undef" if the structure does not have a starting brace. Under normal parsing circumstances this should never occur, but may happen due to manipulation of the PDOM tree. finish The "finish" method returns the finish brace for the structure (i.e. the closing brace). Returns the brace as a PPI::Token::Structure or "undef" if the structure does not have a finishing brace. This can be quite common if the document is not complete (for example, from an editor where the user may be halfway through typeing a subroutine). braces The "braces" method is a utility method which returns the brace type, regardless of whether has both braces defined, or just the starting brace, or just the ending brace. Returns on of the three strings '[]', '{}', or '()', or "undef" on error (primarily not having a start brace, as mentioned above). complete The "complete" method is a convenience method that returns true if the both braces are defined for the structure, or false if only one brace is defined. Unlike the top level "complete" method which checks for completeness in depth, the structure complete method ONLY confirms completeness for the braces, and does not recurse downwards. SUPPORT
See the support section in the main module. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.16.2 2011-02-25 PPI::Structure(3)
All times are GMT -4. The time now is 11:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy