LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 12-08-2005, 06:06 AM   #1
Lotharster
Member
 
Registered: Nov 2005
Posts: 144

Rep: Reputation: 15
command line arguments containing (


I'd like to pass a string that contains brackets '(' as a command line argument to a script, like e.g.
Code:
$ calc f(x)
But there's a bash error:
bash: syntax error near unexpected token `('
I know that I can use '\(', but this can become quite cumbersome when using many brackets. Is there a better way?
 
Old 12-08-2005, 06:27 AM   #2
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,192

Rep: Reputation: 101Reputation: 101
wrap the arguments in quotes?
Code:
calc "f(x)"
 
Old 01-05-2006, 07:51 AM   #3
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 56
Ofcourse, if it is the result of the calc statement that you wanted passed as an argument to another command, you could wrap the whole thing in left-hand quotes:
Code:
$ newcommand `calc f(x)`
 
Old 01-05-2006, 08:43 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
si the calc function expecting a string similar to "f(x)"? If so, then simply use the parantheses.
Otherwise, let us know what calc expects.....
 
  


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
alsamixer command line arguments dereko Debian 3 09-29-2008 02:06 PM
Awk command-line arguments lowpro2k3 Programming 1 03-28-2005 09:09 PM
number of command line arguments to shell u4u Linux - General 1 03-04-2005 06:09 PM
Help with command line arguments ? synapse Linux - Newbie 2 02-23-2004 02:25 AM
Command line arguments to java program Majjj Programming 3 10-23-2003 05:48 AM


All times are GMT -5. The time now is 08:48 AM.

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