Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8389979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:52:02+00:00 2026-06-09T18:52:02+00:00

The goal is to create a one line (copy and paste) bash command. The

  • 0

The goal is to create a one line (copy and paste) bash command. The bash one line command should partition and format a drive, and when that results in a mountable volume, some initial maintenance commands.

The goal is to execute a list of commands when cd /Volumes/VolumeName succeeds in the current shell context. This grouping of commands can be done in bash by using curly braces. When cd /Volumes/VolumeName fails (echo $? != 0) further command execution is not necessary and command execution can stop.

The result of command cd /Volumes/$VOL && {sudo rm -fr .{,_.}{fseventsd,Spotlight-V100,Trashes}; mkdir .fseventsd;} is:

-bash: syntax error near unexpected token `}'

The bottleneck might be that one of the commands in the curly braced command list is using curly braces for list generation: sudo rm -fr .{,_.}{fseventsd,Spotlight-V100,Trashes}.

How to nest curly braces for list generation inside a curly brace command group?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:52:03+00:00Added an answer on June 9, 2026 at 6:52 pm

    You’re just missing a necessary leading space. Consider:

    mini:~ michael$ { echo sudo rm -fr .{,_.}{fseventsd,Spotlight-V100,Trashes}; echo mkdir .fseventsd;}
    sudo rm -fr .fseventsd .Spotlight-V100 .Trashes ._.fseventsd ._.Spotlight-V100 ._.Trashes
    mkdir .fseventsd
    mini:~ michael$ {echo sudo rm -fr .{,_.}{fseventsd,Spotlight-V100,Trashes}; echo mkdir .fseventsd;}
    -bash: syntax error near unexpected token `}'
    

    If you look in man 1 bash under the Compound Commands section you’ll see this (emphasis mine):

    { list; }

    list is simply executed in the current shell environment. list must be terminated with a newline or semicolon. This is known as a group command. The return status is the exit status of list. Note that unlike the metacharacters ( and ), { and } are reserved words and must occur where a reserved word is permitted to be recognized. Since they do not cause a word break, they must be separated from list by whitespace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to create an entry form (addnew.php) that will allow me to
The goal is, when I focus on the last text line, another one appears
My goal is to create a map of maps so that I can retrieve
I want to do auto scaling using knife command line tool. My main goal
Goal: to create a percentage column based off the values of calculated columns. Here's
Duplicate: PHP validation/regex for URL My goal is create a PHP regex for website
I am very new to Json and my goal to create the Json output
My goal is to create a canned email on my server and then send
My goal is to create a list from menu.bin. This is the func: pitem
my goal is to create a sort of Javascript library, if you could call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.