LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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: 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.
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,272

Rep: Reputation: 154Reputation: 154
wrap the arguments in quotes?
Code:
calc "f(x)"
 
Old 01-05-2006, 07:51 AM   #3
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
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: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration