Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: semicolon for perl command in bash

by hippo (Monsignor)
on Oct 17, 2012 at 22:00 UTC ( #999618=note: print w/replies, xml ) Need Help??


in reply to semicolon for perl command in bash

The semi-colon in bash is the statement terminator. If you do not use a semi-colon then your statement is terminated by a newline. Both the semi-colon and the newline can be escaped. This is all to do with bash and nothing to do with perl.

As examples try these:

  • $ echo foo
  • $ echo foo;
  • $ echo foo\;
  • $ echo foo; echo bar
  • $ echo foo\; echo bar

Happy bashing!

Replies are listed 'Best First'.
Re^2: semicolon for perl command in bash
by mianfeidewucan (Initiate) on Oct 17, 2012 at 22:18 UTC
    Hi,

    I didn't know the semicolon and newline are equivalent. Thank you very much!

    Arrow

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://999618]
help
Chatterbox?
[1nickt]: Life is weird. Just reading about the iPhone battery problems and saw: 'It’s like calling water “dihydrogen monoxide”'

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2016-12-06 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (105 votes). Check out past polls.