Find the answer to your Linux question:
Results 1 to 2 of 2
Hi everybody, I have read that commands which will be excuted in between curly braces ( { } ) will be executed in the current shell only. But I am ...
  1. #1
    Linux Newbie
    Join Date
    Jul 2004
    Posts
    143

    excuting commands with { }

    Hi everybody,

    I have read that commands which will be excuted in between curly braces ({ }) will be executed in the current shell only.

    But I am getting the following error...
    # {pwd;ls;}
    bash: syntax error near unexpected token `}'

    What would be the problem. Please help me..

    Thanks Inadvance,
    Mummaneni.

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    # {pwd;ls;}
    there should be a space after { and between ; and }.
    Code:
    { pwd;ls; }
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...