Sponsored Content
Top Forums Shell Programming and Scripting awk fails when using variable Post 302743571 by michaelrozar17 on Thursday 13th of December 2012 03:12:18 AM
Old 12-13-2012
@Scrutinizer

Since both the variable and its value contains character c, i was getting the correct result while testing.However i must have verified again the command.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

csh fails when setting variable

I have a csh that is called from autosys. It fails when it hits this code env | grep Rep if ( $status == 0 ) then echo "" else setenv REP "" endif However if I run it from the command line, as opposed to from autosys (job schduler) it runs fine. I thought it might be some kind of... (2 Replies)
Discussion started by: gillbates
2 Replies

2. Shell Programming and Scripting

using awk for setting variable but change the output of this variable within awk

Hi all, Hope someone can help me out here. I have this BASH script (see below) My problem lies with the variable path. The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level. The... (6 Replies)
Discussion started by: Cowardly
6 Replies

3. Shell Programming and Scripting

awk substr fails

Hi all, I want to get each line of a data file from position 464 plus 8 characters. I tried in two different ways, and the results were different. I'd like to know why. First method, using awk: awk '{print substr($0,464,8)}' CONCIL_VUELTA_ALF_100112_0801.okSecond method, using scripting:... (5 Replies)
Discussion started by: AlbertGM
5 Replies

4. Shell Programming and Scripting

echoing complex awk command into file fails

Using hp-ux's shell, I'm trying to echo a complex awk command into a script file for later use. But it fails on a newline character and splits the rest of the command onto the next line. echo ' printf("%s: TOTAL = %18.0lf\n", FILENAME, TOTAL) >> "TOTAL.TXT";' >>awk.script Looks... (3 Replies)
Discussion started by: Scottie1954
3 Replies

5. Shell Programming and Scripting

SH script, variable built command fails, but works at command line

I am working with a sh script on a solaris 9 zone (sol 10 host) that grabs information to build the configuration command line. the variables Build64, SSLopt, CONFIGopt, and CC are populated in the script. the script includes CC=`which gcc` CONFIGopt=' --prefix=/ --exec-prefix=/usr... (8 Replies)
Discussion started by: oly_r
8 Replies

6. UNIX for Dummies Questions & Answers

Find command fails when a space is in the directory path variable

I have a script like this running under OS X 10.8. The problem arises when the find command encounters a space in the path name. I need the "dir" variable as I'll be extending the script to more general use. #!/bin/bash CFS=$IFS IFS=$(echo) set dir = "/Users/apta/Library/Mail\... (3 Replies)
Discussion started by: apta
3 Replies

7. Shell Programming and Scripting

sed variable expansion fails for substitution in range

I'm trying to change "F" to "G" in lines after the first one: 'FUE.SER' 5 1 1 F0501 F0401 F0502 2 1 F0301 E0501 F0201 E0502 F0302 3 1 F0503 E0503 E0301 E0201 E0302 E0504 F0504 4 1 F0402 F0202 E0202 F0101 E0203 F0203 F0403 5 1 F0505 E0505 E0303 E0204 E0304 E0506... (10 Replies)
Discussion started by: larrl
10 Replies

8. Shell Programming and Scripting

awk works on Linux but fails on Solaris

On linux i have the below command working fine. awk '/<app-deploy>/{A=1;++i} /<\/app-deploy>/{print >> "found"i".tmp";A=0} A{;print >> "found"i".tmp"}' deploy.xml But the same is failing on Solaris Output: awk: syntax error near line 1 awk: bailing out near line 1 uname -a SunOS mymac 5.10... (5 Replies)
Discussion started by: mohtashims
5 Replies

9. Shell Programming and Scripting

Expansion of variable inside Single Quotes Fails!!

I am unable to expand the value of entry variable inside the nawk command. I tried three different nawk command as below but none of them substitute the value of entry variable. ls *.txt | while IFS='' read -r entry; do #nawk '/<name>/{A=1;++i} A{print >> ("cmd"i"_"$entry)}... (9 Replies)
Discussion started by: mohtashims
9 Replies

10. Shell Programming and Scripting

Looping on variable having new line \n fails

I have a for loop that constructs a variable "filelistonly" having entries separated by "\n" new line. The second, third & fourth while loops are my attempt to iterate the variable "filelistonly" upon new line "\n", however non of them work. Below is my script: //First Loop for i in... (2 Replies)
Discussion started by: mohtashims
2 Replies
exp(3m) 																   exp(3m)

Name
       exp, expm1, log, log10, log1p, pow - exponential, logarithm, power

Syntax
       #include <math.h>

       double exp(x)
       double x;

       float fexp(x)
       float x;

       double expm1(x)
       double x;

       float fexpm1(x)
       float x;

       double log(x)
       double x;

       float flog(x)
       float x;

       double log10(x)
       double x;

       float flog10(x)
       float x;

       double log1p(x)
       double x;

       float flog1p(x)
       float x;

       double pow(x,y)
       double x,y;

Description
       The and functions return the exponential function of x for double and float data types, respectively.

       The and functions return exp(x-1 accurately, including tiny x for double and float data types, respectively.

       The and functions return the natural logarithm of x for double and float data types, respectively.

       The and functions return the logarithm of x to base 10 for double and float data types, respectively.

       The and functions return log(1+x) accurately, including tiny x for double and float data types, respectively.

       The function returns x**y.

   Error (due to roundoff)
       The and functions are accurate to within an ulp, and is accurate to within approximately 2 ulps; an ulp is one Unit in the Last Place.

       The  function  is accurate to within 2 ulps when its magnitude is moderate, but becomes less accurate as the result approaches the overflow
       or underflow thresholds.  Theoretically, as these thresholds are approached, almost as many bits could be lost from the result as are indi-
       cated  in  the exponent field of the floating-point format for the resultant number.  In other words, up to 11 bits for an IEEE 754 double-
       precision floating-point number.  However, testing has never verified loss of precision as drastic as 11 bits.  The worst cases have  shown
       accuracy  of  results  to within 300 ulps for IEEE 754 double-precision floating-point numbers.	In general, a (integer, integer) result is
       exact until it is larger than 2**53 (for IEEE 754 double-precision floating-point).

Return Values
       All of the double precision functions return NaN if x or y is NaN.

       The function returns HUGE_VAL when the correct value would overflow, and zero when the correct value would underflow.

       The and functions return NaN when x is less than or equal to zero or when the correct value would overflow.

       The function returns NaN if x or y is NaN.  When both x and y are zero, 1.0 is returned.  When x is negative and y is not an  integer,  NaN
       is returned.  If x is zero and y is negative, -HUGE_VAL is returned.

       The function returns NaN when x is negative.

See Also
       math(3m)

								       RISC								   exp(3m)
All times are GMT -4. The time now is 08:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy