Thanks for sharing this!  TIL!


Chris Gauthier Senior Network Engineer | Comscore
t +1 (503) 331-2704 |
cgauth...@comscore.com
comscore.com
​​​This e-mail (including any attachments) may contain information that is 
private, confidential, or protected by attorney-client or other privilege. If 
you received this e-mail in error, please delete it from your system and notify 
sender.
-----Original Message-----
From: "Piegorsch, Weylin William" <wey...@bu.edu>
Date: Tuesday, June 18, 2019 at 2:03 AM
To: Jean Benoit <j...@unistra.fr>
Cc: "Gauthier, Chris" <cgauth...@comscore.com>, Michael Newton 
<mnew...@pofp.com>, Vacheslav Zouhairy <m_zouha...@skno.by>, 
"rancid-discuss@shrubbery.net" <rancid-discuss@shrubbery.net>
Subject: Re: [rancid] Unable to figure out "end of run not found"

> you can even put redirects

That's a neat trick!!!  I'll have to remember that one; thanks!
__

weylin

On 6/17/19, 5:27 PM, "Jean Benoit" <j...@unistra.fr> wrote:

    On Mon, Jun 17, 2019 at 09:05:13PM +0000, Piegorsch, Weylin William wrote:
    > I actually don't use the semicolon.
    > Not sure if this is bash specific, sh specific, or posix general, but
    > without the semicolon it sets the global environment variable only for the
    > duration of that command following the variable definition, and unset it
    > upon returning control to the cli. See also your "export" comment, which
    > has correlating implications regarding environment vs namespace vs scope.
    > But I'm not an experienced programmer, and don't pretend to grok the
    > various nuances, benefits, and pitfalls known by those who actually know
    > what they're doing, so if using the semicolon is better I all ears.

    You are right: ; is not necessary.

    NOPIPE=yes rancid -d -t type devicename

    is is a perfectly valid syntax according to POSIX Shell Grammar Rules.
    It works with bash, dash, ksh, zsh and other shells.

    
https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fpubs.opengroup.org%2fonlinepubs%2f9699919799%2futilities%2fV3_chap02.html%23tag_18_10_02&c=E,1,pVeiRZ33eh0bANTtrPcyWLXgDYYcEhv1fVgAMKs-rqhpxiQGGKwtaHnc1ENunuBCFwIl6XJo0fGwJdkcHgduuUt2gpDkO7h_-c4J99skKxG0vy0,&typo=1
    see "simple_command" syntax and rule 7, which defines "ASSIGNMENT_WORD".

    simple_command   : cmd_prefix cmd_word cmd_suffix
                     | cmd_prefix cmd_word
                     | cmd_prefix
                     | cmd_name cmd_suffix
                     | cmd_name

    cmd_prefix       :            io_redirect
                     | cmd_prefix io_redirect
                     |            ASSIGNMENT_WORD
                     | cmd_prefix ASSIGNMENT_WORD

    You don't need the ; and you dont need export, and you can even put
    redirects, as long as assignments are before the command.
    Example :
    XYZ=foo </tmp/x >/tmp/y A=1 B=bar mycommand myarg

    --
    Jean



_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss

Reply via email to