@cfajohnson
I only agree with the simplification of the "not" condition in the first command you post. The rest is pedantic and naive and reduces the resiliance of the script to duff parameters and similar environment variable names.
If you write your scripts correctly, you don't need that "protection".
Quote:
If I thought that there were lots of parameters I would have posted:
That is the same as:
The braces and quotes are unnecessary in any circumstances.
If you don't know what is required and what is not, how do you know what difference extra "precautions" will make?
Last edited by cfajohnson; 02-09-2011 at 07:57 PM..
I'm trying to use the following command to do a batch find and replace in all commonly named files through a file hierarchy
find . -name 'file' |xargs perl -pi -e 's/find/replace/g'
which works fine except for a substitution involving parenthesis.
As a specific example I'm trying to sub... (3 Replies)
Hi
I would like to replace a comma in parentheses to a semicolon for example. Other commas outside () stay unchanged. How can I do this?
aaaa,bbb,ccc,ddd(eee,fff,ggg),hhh,iii
to
aaaa,bbb,ccc,ddd(eee;fff;ggg),hhh,iii
Thanks (5 Replies)
hi, unix gurus.
i am wondering if someone can give me a clear explanation of the differneces between parentheses and brackets, both single and double.
i have heard that double parentheses (( are used for numerical expressions and that single brackets [ are used for strings. but i see... (1 Reply)
Hello,
I have done a great deal of research on this and still cannot come to an understanding of the following:
In if-else statements in shell scripting I have seen examples of single brackets, double brackets, single parantheses, and double paratheses. When should each one be used?
And... (2 Replies)
Hi
I have a file with numbers like this :
123
456
6798
9073233
12
8644
Now, I need to insert parentheses to each and every line like below :
(123)
(456)
(6798)
(9073233)
(12)
(8644)
can anyone tell me a solution? (8 Replies)
Hi,
I tried to adapt bartus's solution to my problem, without success. I want to replace all the occurences of this:
with:
, where something can contain an arbitrary number of balanced parens and brakets.
Any ideas ?
Best, (1 Reply)
I was looking at a script in my little book on bash and saw that one of the if statements had parentheses instead of brackets for the condition. I've been trying to find in my book where it talks about parentheses (because the examples on the if statement in an earlier chapter doesn't seem to... (3 Replies)
This is my input file:
a|b|c(ef)|g|h(km)|p
My output file should look like:
a|b|ef|g|km|p
That is, pipe is the delimiter. The data within pipe must be displayed as it is but if it encounters any data within parentheses, then only the data within parentheses has to be displayed ( the data... (2 Replies)
How to remove first pair of parentheses and content in them from the beginning of the line?
Here's the list:
(ok)-test
(ok)-test-(ing)
(some)-test-(ing)-test
test-(ing)
Desired result:
test
test-(ing)
test-(ing)-test
test-(ing)
Here's what I already tried with GNU sed:
sed -e... (6 Replies)
Suppose I have this code :
int main () { int i = NULL; /* incorrect */ return 0; }
and I want to put the word between the two parentheses
like this :
int main (void) { int i = NULL; /* incorrect */ return 0; }
which command is used to do it in Linux ? (2 Replies)
Discussion started by: steve120
2 Replies
LEARN ABOUT REDHAT
pdl::gslsf::airy
AIRY(3) User Contributed Perl Documentation AIRY(3)NAME
PDL::GSLSF::AIRY - PDL interface to GSL Special Functions
DESCRIPTION
This is an interface to the Special Function package present in the GNU Scientific Library.
SYNOPSIS FunctionsFUNCTIONS
gsl_sf_airy_Ai
Signature: (double x(); double [o]y(); double [o]e())
Airy Function Ai(x).
gsl_sf_airy_Bi
Signature: (double x(); double [o]y(); double [o]e())
Airy Function Bi(x).
gsl_sf_airy_Ai_scaled
Signature: (double x(); double [o]y(); double [o]e())
Scaled Airy Function Ai(x). Ai(x) for x < 0 and exp(+2/3 x^{3/2}) Ai(x) for x > 0.
gsl_sf_airy_Bi_scaled
Signature: (double x(); double [o]y(); double [o]e())
Scaled Airy Function Bi(x). Bi(x) for x < 0 and exp(+2/3 x^{3/2}) Bi(x) for x > 0.
gsl_sf_airy_Ai_deriv
Signature: (double x(); double [o]y(); double [o]e())
Derivative Airy Function Ai`(x).
gsl_sf_airy_Bi_deriv
Signature: (double x(); double [o]y(); double [o]e())
Derivative Airy Function Bi`(x).
gsl_sf_airy_Ai_deriv_scaled
Signature: (double x(); double [o]y(); double [o]e())
Derivative Scaled Airy Function Ai(x). Ai`(x) for x < 0 and exp(+2/3 x^{3/2}) Ai`(x) for x > 0.
gsl_sf_airy_Bi_deriv_scaled
Signature: (double x(); double [o]y(); double [o]e())
Derivative Scaled Airy Function Bi(x). Bi`(x) for x < 0 and exp(+2/3 x^{3/2}) Bi`(x) for x > 0.
AUTHOR
This file copyright (C) 1999 Christian Pellegrin <chri@infis.univ.trieste.it> All rights reserved. There is no warranty. You are allowed to
redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this
file is separated from the PDL distribution, the copyright notice should be included in the file.
The GSL SF modules were written by G. Jungman.
perl v5.8.0 2003-01-29 AIRY(3)