gana2188 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

v0.9.17 CLI wrappers fail with "Bad Substitution" error when /bin/sh is set to dash (default on Ubuntu) #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Upgrade SDK to 0.9.17 on Ubuntu 12.04
2. Run bq, gcutil, or gsutil (e.g., "bq help")

What is the expected output? What do you see instead?

/path/to/google-cloud-sdk/bin/gcutil: 7: /path/to/google-cloud-sdk/bin/gcutil: 
Bad substitution

What version of the product are you using? On what operating system?

$ gcloud version
Google Cloud SDK 0.9.17
Copyright Google Inc. 2013.

bq 2.0.18
bq-nix 2.0.18
core 2014.02.25
core-nix 2014.01.27
gcutil 1.13.0
gcutil-nix 1.13.0
gsutil 3.42
gsutil-nix 3.42
sql 2014.02.25

Please provide any additional information below.

The bq, gsutil, and gcutil scripts in this version of the SDK have been changed 
to wrappers that invoke run_cloudsdk_legacy_cli. The scripts have the shebang 
line:

   #!/bin/sh

But the default on Ubuntu (for some time now, see: 
https://wiki.ubuntu.com/DashAsBinSh) /bin/sh is a symlink to 'dash':

   $ ls -l /bin/sh
   lrwxrwxrwx 1 root root 4 Sep 24  2012 /bin/sh -> dash

Line 7 of all three wrappers is:

   apparent_wrapper_script_dir="${script_link/${tool}/}"

which causes dash to issue a "Bad substitution" error. (Perhaps the nested 
substitution?)

Changing the shebang line to

   #!/bin/bash

or invoking the scripts with bash directly

   bash ./gsutil help

and it works fine.

Original issue reported on code.google.com by chad.ho...@gmail.com on 26 Feb 2014 at 10:34

GoogleCodeExporter commented 9 years ago
mia culpa. top priority.

Original comment by jasm...@google.com on 27 Feb 2014 at 12:38

GoogleCodeExporter commented 9 years ago
A fix for this has been pushed. Please update!

Original comment by jasm...@google.com on 27 Feb 2014 at 3:58

GoogleCodeExporter commented 9 years ago
All good now after a "gcloud components update".

Original comment by chad.ho...@gmail.com on 27 Feb 2014 at 2:39