LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-26-2009, 01:54 PM   #1
ty1on
LQ Newbie
 
Registered: Aug 2009
Posts: 2

Rep: Reputation: 0
-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?
 
Old 08-26-2009, 01:57 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,524
Blog Entries: 27

Rep: Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175Reputation: 1175
Try
Code:
vmkfstools -X 60G '/vmfs/volumes/NonProd-IDN-03/SQ01WDCHC/SQ01WDCHC (KeyPower - Developmen-000001.vmdk'
 
Old 08-26-2009, 02:00 PM   #3
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,453

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
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.
 
Old 08-26-2009, 02:19 PM   #4
ty1on
LQ Newbie
 
Registered: Aug 2009
Posts: 2

Original Poster
Rep: Reputation: 0
To both Catkin & colucix

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error near unexpected token fi Nortekman Linux - Newbie 8 02-27-2009 03:48 PM
syntax error near unexpected token in bash using perl kambrish Programming 21 07-03-2007 12:42 PM
syntax error near unexpected token `else' josedias Programming 3 09-11-2006 07:09 PM
Trouble with Bash -- syntax error near unexpected token `fi' anamericanjoe Programming 5 05-19-2006 02:59 PM
syntax error near unexpected token ` mattyspatty Programming 8 05-07-2006 05:19 PM


All times are GMT -5. The time now is 07:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration