Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-08-2005, 07:06 AM   #1
Registered: Nov 2005
Posts: 144

Rep: Reputation: 18
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.
$ 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, 07:27 AM   #2
Senior Member
Registered: Oct 2004
Posts: 1,192

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

Rep: Reputation: 57
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:
$ newcommand `calc f(x)`
Old 01-05-2006, 09:43 AM   #4
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735
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.....


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

All times are GMT -5. The time now is 06:05 AM.

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