LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   -bash: syntax error near unexpected token (https://www.linuxquestions.org/questions/linux-newbie-8/bash-syntax-error-near-unexpected-token-750445/)

ty1on 08-26-2009 01:54 PM

-bash: syntax error near unexpected token
 
-bash: syntax error near unexpected token '('

when typing the following command

vmkfstools -X 60G /vmfs/volumes/NonProd-IDN-03/SQ01WDCHC/SQ01WDCHC (KeyPower - Developmen-000001.vmdk

I need to extend the size of the disk from 30G to 60G. I suspect that the name of the vmdk file is the issue and my question is, is there any way around this to be? Can I extend the disk with the name that contains spaces as well as a left parenthesis?

catkin 08-26-2009 01:57 PM

Try
Code:

vmkfstools -X 60G '/vmfs/volumes/NonProd-IDN-03/SQ01WDCHC/SQ01WDCHC (KeyPower - Developmen-000001.vmdk'

colucix 08-26-2009 02:00 PM

Welcome to LinuxQuestions! :)

Since the parenthesis has a special meaning in bash you have to force the shell to interpret it literally. To do this just embed the file name in single quotes. In alternative escape the special characters using backslash, for example:
Code:

SQ01WDCHC\ \(KeyPower\ -\ Developmen-000001.vmdk
here both the parenthesis and the blank spaces are escaped.

ty1on 08-26-2009 02:19 PM

To both Catkin & colucix

That did the trick a single quote at the beginning and end of the argument.


All times are GMT -5. The time now is 04:29 PM.