Sponsored Content
Special Forums UNIX Desktop Questions & Answers How to store the value of grep in a variable Post 302639279 by learninguser235 on Friday 11th of May 2012 12:37:27 PM
Old 05-11-2012
Thanks gary_w and methyl, it worked after correcting the space, i am using space after "=" sign .
This User Gave Thanks to learninguser235 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep and store

When i grep a file and store it in a file it is storing as a zero byte file any way to avoid that..... (6 Replies)
Discussion started by: arunkumar_mca
6 Replies

2. Shell Programming and Scripting

Grep results to store in a shell variable

I have the results of a grep with -n store in a shell variable ie VAR=`grep -n -e 'PATTERN' file` How ever I am missing the line breaks in the variable , How do I store the resualts of grep with many lines in to a variables. I want the varable should be the sawmway as we do the grep grep... (3 Replies)
Discussion started by: jojan
3 Replies

3. Shell Programming and Scripting

how to store grep command in a Variable

I have a variable A echo $A 5060 I am exporting the value X,Y,Z and it id fetching right thing and When I run C=`${X} -l ${Y} ${Z} "trap '' INT;. ~/.profile >/dev/null 2>/dev/null; netstat -na | grep \$A`" here it is going to same directory and also running netstat -na | grep 5060 ... (4 Replies)
Discussion started by: madhusmita
4 Replies

4. UNIX for Dummies Questions & Answers

Using GREP/AWK to extract a number and store it as a variable

Hello, I have a question regarding the awk command. Here is the line I need to grep: 1 F= -.13250138E+03 E0= -.13249556E+03 d E =-.174650E-01 mag= 35.2157 Instead of displaying the number in red I would like to store it as a variable such as X. Is there a way to do this? Thanks for any... (3 Replies)
Discussion started by: modey3
3 Replies

5. Shell Programming and Scripting

grep attribute value pair and store it a variable

Hi, I have a file contains attribute value pair like.. ..name=erick rollno=583.0 pass=recon.. From the above line, i need to grep for only "rollno" and store "rollno=583.0" in a variable. Pls suggest (6 Replies)
Discussion started by: skraja1982
6 Replies

6. Shell Programming and Scripting

Help in scripting, store value in variable

Hi all, I have a script in which i need to run a command like "/opt/dell/srvadmin/sbin/omreport about" and output will be something like Version : 6.3.0 Copyright : Copyright (C) xxx Inc. 1995-2010 All rights reserved. Company : xxx Inc. In this i need to save the version... (13 Replies)
Discussion started by: Renjesh
13 Replies

7. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

8. UNIX for Dummies Questions & Answers

How to grep and store in a file

Guys, I was wondering what command can be used to parse the "LaxOrdID" field into a separate file? These messages are in thousands and I need to perform a comparision. (6 Replies)
Discussion started by: DallasT
6 Replies

9. Shell Programming and Scripting

How to store result of grep into a variable?

In a directory i have a file *output* whose contents are changing for every simulation. zgrep "trace file is" *output* | zgrep g o/p: trace file is Int_01.1352176388z4f56ec33.0.trace.gz I want to extract "Int_01.1352176388z4f56ec33.0.trace.gz" from the above result into a variable. i... (2 Replies)
Discussion started by: twistedpair
2 Replies

10. Shell Programming and Scripting

I can't store value in the variable

!#bin/bash clear var= grep @gmail.com email.txt | wc -l echo $var echo $var exit 0 OUTPUT: 1000 _ _ Where _ represent space (no value or nothing) (4 Replies)
Discussion started by: Muhammad Rehan
4 Replies
strtod(3C)																strtod(3C)

NAME
strtod(), strtof(), strtold(), strtow(), strtoq(), atof() - convert string to floating-point number SYNOPSIS
Itanium(R)-based Systems Only DESCRIPTION
returns, as a double-precision floating-point number, the value represented by the character string pointed to by str. The string is scanned (leading white-space characters as defined by in ctype(3C) are ignored) up to the first unrecognized character. If no conversion can take place, zero is returned. recognizes characters in the following sequence: 1. An optional string of white space characters which are ignored 2. An optional sign and one of the following: 3. A string of digits optionally containing a radix character, followed by an optional or followed by an optional sign or space, followed by an integer 4. One of or ignoring case 5. ignoring case 6. For Itanium-based system only: or then a nonempty sequence of hexadecimal digits optionally containing a radix character, then a or followed by an optional sign or space, followed by a decimal integer The radix character is determined by the loaded environment (see setlocale(3C)). If has not been called successfully, the default environ- ment, "C", is used (see lang(5)). The default environment specifies a period as the radix character. In the hexadecimal form, the optionally signed decimal integer following the or is interpreted as the power of 2 by which the significant part is to be scaled. If the value of ptr is not the variable to which it points is set to point at the character after the last number, if any, that was recog- nized. If no number can be formed, is set to str, and zero is returned. is equivalent to is a version of it returns a result. For PA-RISC and for Itanium-based systems, if the user has defined the result type is declared as a instead of as a The declaration with a is obsolescent. Itanium-based Systems Only is a version of it returns a result. is an version of it returns an result. is equivalent to EXTERNAL INFLUENCES
Environment Variables determines the value of the radix character within the currently loaded environment. APPLICATION USAGE
To use (for Itanium-based systems) or compile with the option. RETURN VALUE
If the correct value would cause overflow, returns (equal to according to the sign of the value, and sets to If the correct value would be nonzero but too small in magnitude to represent as a nonzero then returns zero and sets to For Itanium-based system, also sets to whenever the conversion of its input parameter character string to raises the underflow exception. When the input parameter character string for after the optional white space and sign, is either (case insensitive) or (case insensitive) will return according to the sign indicated by the character string. When the input parameter character string for after the optional white space and sign, is (case insensitive), will return a quiet NaN. On Itanium-based systems, these functions round correctly for hexadecimal input strings, and round correctly for up to 36 significant deci- mal digits, according to the specification in ISO/IEC C99. SEE ALSO
ctype(3C), setlocale(3C), scanf(3S), strtol(3C), lang(5), thread_safety(5). STANDARDS CONFORMANCE
strtod(3C)
All times are GMT -4. The time now is 03:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy