Skip to main content
deleted 308 characters in body
Source Link
Joseph R.
  • 40.6k
  • 8
  • 115
  • 146

You need to quote parts of your command containing spaces to prevent word splitting from making them into two different arguments:

cp -Rf "$APP_PROTOTYPE/" "Payload/${BUNDLE_NAME}.app" 

should do what you want. Note that you need double quotes rather than single quotes to allow for variable interpolation inside the quotes.

The output of echo doesn't mean that the command should work properly. Unquoted spaces cause the echo statement to have multiple arguments: the first argument is $APP_PROTOTYPE/ (assuming the expansion of APP_PROTOTYPE doesn't produce any whitespace) and the second argument is Payload/${BUNDLE_NAME}.app, with a similar assumption for the expansion of BUNDLE_NAME. Now unlikeUnlike cp, which deals in path names, echo is perfectly fine with one argument becoming several ones due to word splitting:

echo 'a b' 

and

echo a b 

should both produce the same result.

You need to quote parts of your command containing spaces to prevent word splitting from making them into two different arguments:

cp -Rf "$APP_PROTOTYPE/" "Payload/${BUNDLE_NAME}.app" 

should do what you want. Note that you need double quotes rather than single quotes to allow for variable interpolation inside the quotes.

The output of echo doesn't mean that the command should work properly. Unquoted spaces cause the echo statement to have multiple arguments: the first argument is $APP_PROTOTYPE/ (assuming the expansion of APP_PROTOTYPE doesn't produce any whitespace) and the second argument is Payload/${BUNDLE_NAME}.app, with a similar assumption for the expansion of BUNDLE_NAME. Now unlike cp, which deals in path names, echo is perfectly fine with one argument becoming several ones due to word splitting:

echo 'a b' 

and

echo a b 

should both produce the same result.

You need to quote parts of your command containing spaces to prevent word splitting from making them into two different arguments:

cp -Rf "$APP_PROTOTYPE/" "Payload/${BUNDLE_NAME}.app" 

should do what you want. Note that you need double quotes rather than single quotes to allow for variable interpolation inside the quotes.

The output of echo doesn't mean that the command should work properly. Unlike cp, which deals in path names, echo is perfectly fine with one argument becoming several ones due to word splitting:

echo 'a b' 

and

echo a b 

should both produce the same result.

Source Link
Joseph R.
  • 40.6k
  • 8
  • 115
  • 146

You need to quote parts of your command containing spaces to prevent word splitting from making them into two different arguments:

cp -Rf "$APP_PROTOTYPE/" "Payload/${BUNDLE_NAME}.app" 

should do what you want. Note that you need double quotes rather than single quotes to allow for variable interpolation inside the quotes.

The output of echo doesn't mean that the command should work properly. Unquoted spaces cause the echo statement to have multiple arguments: the first argument is $APP_PROTOTYPE/ (assuming the expansion of APP_PROTOTYPE doesn't produce any whitespace) and the second argument is Payload/${BUNDLE_NAME}.app, with a similar assumption for the expansion of BUNDLE_NAME. Now unlike cp, which deals in path names, echo is perfectly fine with one argument becoming several ones due to word splitting:

echo 'a b' 

and

echo a b 

should both produce the same result.