Alright, here's the deal. I'm running the following ruby script (output follows):
I want to just grab the "57/33" portion, but that's it. I don't want any other portion of the line. I want to be able to grab dynamically as everything changes depending on the weather.
My idea was to do something along the lines of
but this obviously returns the whole line.
Ideally I'd like to display the following (though I'm not sure it can be done without a script):
Quote:
high: 57F
low: 33F
Any help would be great. Thanks!
---------- Post updated at 03:04 PM ---------- Previous update was at 02:45 PM ----------
I ended up just editing the script itself (doh!). I still would be interested to know if there's a way to grab just portions of text though...
friends, i am a newbie in scripting. could someone help me in selecting only the last column of below ps command output ?
mqm 14 16466 0 Sep 15 ? 0:01 /opt/mqm/bin/runmqlsr -r -m QMGR.INBOUNDSSL -t TCP -p 1415 -i 5.1.26.5
mqm 12 16700 0 Sep 15 ? 0:00... (4 Replies)
I have a text wich looks like this:
clid=2 cid=6 client_database_id=35 client_nickname=Peter client_type=0|clid=3 cid=22 client_database_id=57 client_nickname=Paul client_type=0|clid=5 cid=22 client_database_id=7 client_nickname=Mary client_type=0|clid=6 cid=22 client_database_id=6... (3 Replies)
I have a working script to find out the IP of a hostname like this:
#!/bin/bash
h="www.google.com"
echo $h
j=`host $h | grep -o '\{1,3\}\.\{1,3\}\.\{1,3\}\.\{1,3\}'`
echo "ip: $j"
output
ip: 74.125.19.99
the strange thing is if I use an IP instead of a hostname for $h, it inverts the... (2 Replies)
I have several files with say something like
cat
sparrow
I can grep for "cat" and "sparrow" and usually the output is one below the other
cat
sparrow
How can I view these as columns say
Pets Birds
cat sparrow
Would be great if this can be on command line using awk or... (1 Reply)
Hi all,
I'm trying to gather data directly following a keyword in a file but I have no guarantee where it will appear in said file so I can't use cut or anything else that assumes it will be located at a certain position. If anyone has any suggestions I'd be grateful. Here is an example of the... (7 Replies)
Hi. I have a unix script 'if' condition that greps through a file and searches for the strings ERROR and WARNING.
if egrep -q 'ERROR|WARNING' myfile.txt; then
When this 'if' condition is true then I want to be able to capture 10 lines before the string and 10 lines after the string. So... (6 Replies)
Hi All,
Facing an issue with grep & sed
I have logs as below:
gsc_1_20121121.log:2012-11-21 10:09:13,143 INFO - fmsspace.1 ProcessNewOrderSingleRequest: Result - ProcessNewOrderSingleBatchResultDTO - success:true,newOrderSingleBatchResults:ProcessNewOrderSingleResultDTO -... (13 Replies)
Hi ,
I have an issue where I want to parse through the output from a file and I want to grab the nth occurrence of text in between two patterns preferably using awk or sed
! TICKET NBR : 1 !GSI : 102 ! 3100.2.112.1 11/06/2013 15:56:29 ! 3100.2.22.3 98 ! 3100.2.134.2... (8 Replies)
I have a factor program that runs and outputs to stdout all the prime numbers that are specified in the given paramters, in this case 30000000-31000000.
Command:
factor/factor 30000000-31000000
Sample output:
30999979 = 30999979
30999980 = 2^2 5 11 140909
30999981 = 3 10333327... (6 Replies)
Hi,
I am running the following:
PASS="username/password"
sqlplus -s << EOF | grep -v "^$"
$PASS
set feedback off
set heading off
set termout off
select name from v\$database ;
exit
EOF
Which gives
ERROR:
ORA-28002: the password will expire within 5 days
PSMP1 (1 Reply)