Sponsored Content
Full Discussion: Retrieving a specific value
Top Forums Shell Programming and Scripting Retrieving a specific value Post 302528217 by vgersh99 on Monday 6th of June 2011 04:40:41 PM
Old 06-06-2011
Code:
nawk -v thr=14 -F '[:[]' '/>/ {h=$0;p=1;next} {if(NF>2 &&$2<thr){printf("%s%s\n", p?h ORS:"", $0);p=0}}' myFile

Adjust the value of 'thr' to your liking.
 

10 More Discussions You Might Find Interesting

1. AIX

doubt in retrieving date

Hello, instead of specifying the date manually in the list as below, for dt in 010106 010206 010306 010406 010506 010606 here for example : 010106 - 1st jan 2006 how to retrieve the date of a week automatically and put in a loop? is there any way to do? thanks in advance. (1 Reply)
Discussion started by: sumi
1 Replies

2. UNIX for Dummies Questions & Answers

Retrieving output interactively

Hi. I have a situation where I need to constantly read a command's output in order to loop through it to determine something that is happening over our system. The command td <filename> interactively prints 'filename' as text is written to it and this is redirected to standard output. I have been... (8 Replies)
Discussion started by: fidodido
8 Replies

3. UNIX for Dummies Questions & Answers

Retrieving data

Friends, I have a data with 3 columns: 30 41 1 39 19 4 14 25 3 .... .... ..... I want to retrieve any data in the first column that is greater 15. What is the best way to do this? Thanks! (2 Replies)
Discussion started by: bobo
2 Replies

4. UNIX for Dummies Questions & Answers

retrieving files which has more than 0 bytes

Hi, Can anyone tell how to list all files in current directory which has more than 0 bytes? (4 Replies)
Discussion started by: sri2005
4 Replies

5. Solaris

help retrieving files from SunOS 5.8

Hi, I am trying to get a small amount of files off of a SunBlade 2000 running SunOS 5.8, but I'm having trouble finding a medium that will actually work. It is not networked, and it doesn't have a writable CD drive. My only options seem to be floppy disk and USB drive. However, when I insert... (11 Replies)
Discussion started by: ryanm
11 Replies

6. Shell Programming and Scripting

retrieving specific lines from a file - can I use grep ?

Hi there, if i had a file that looked like this my_server1 red green blue yellow blue my_server2 blue blue yellow green blue my_server3 yellow (9 Replies)
Discussion started by: hcclnoodles
9 Replies

7. Shell Programming and Scripting

error in retrieving records from DB

Hi ., I have 3 records in a oracle table... wen i connect to oracle from unix environment and query the table i get some errors... the script i used is g=`sqlplus -s "username/password" << EOF select column from table; EOF` if then echo $g fi The output i get... (1 Reply)
Discussion started by: cratercrabs
1 Replies

8. Shell Programming and Scripting

Retrieving File name

Hi All.. I have a Filename as FAB1_600015_CONRAD.A0_7XYZ12345.000_LT-SWET.01_LTPA25L_20110622-161429_07_WFR12345_20110622-161429_20110712-125228.data.dis I want to get the result as... (5 Replies)
Discussion started by: asheshrocky
5 Replies

9. UNIX for Dummies Questions & Answers

retrieving data between two strings

I have input file like AAA AAA CCC CCC CCC EEE EEE EEE EEE FFF FFF GGG GGG i was trying to retrieve data between two strings using sed. sed -n /CCC/,/FFF/p input_file Am getting output like CCC CCC CCC (22 Replies)
Discussion started by: NareshN
22 Replies

10. Shell Programming and Scripting

Passing argument not retrieving.

Hi I have a script which am trying to pass an argument which am trying to call using $1 but its not taking the value inside the if loop as it showing the error as if: Empty if.. Any help on this will be helpful. #!/usr/bin/csh echo $1 if ('$1' == "pp") then echo "Printing $1" endif (4 Replies)
Discussion started by: rogerben
4 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 10:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy