Search Results

Search: Posts Made By: ther2000
3,202
Posted By ctsgnb
you can get ride off the other comas by adding...
you can get ride off the other comas by adding "s/, / /g" to the sed statement :

example :

$ echo "07/07@11:19:33,-,-,10.7.2.204 ,DIAG 0x0b: Reason: code 0x1, Unmapped address, fault address:...
2,126
Posted By radoulov
Check if your date implementation supports the...
Check if your date implementation supports the no-pad flag:

% date +%b-%d; date +%b--%-d; date -d '+3 days' +%b--%-d
Jul-07
Jul--7
Jul--10
4,082
Posted By snowline84
If you just need teh file names, you can remove...
If you just need teh file names, you can remove supress the spaces from teh output of ls -lrt itself



$ ll
total 0
-rw-r--r-- 1 oper users 0 Jul 6 17:44 345
-rw-r--r-- 1...
10,446
Posted By Shell_Life
This will do it: date +"%b-%d" | sed...
This will do it:
date +"%b-%d" | sed 's/-0/--/'
2,356
Posted By ctsgnb
turning ...
turning

10.7.334.245-ADM-Cisco-Jul--1-13-22-33.txt
into

10.7.334.245-ADM-Cisco-Jul-01-13-22-33.txt


YESTER=`TZ=aaa24 date +%b"-"%d | sed 's/--/-0/'`

---------- Post updated at 09:32...
2,277
Posted By mirni
My suspicion is that $filelist2 might be empty. ...
My suspicion is that $filelist2 might be empty.
Try to echo its value before you call nawk.

And if my suspicion is correct, this is most likely the culprit:
$(find /export/home/gen/cks/traces \(...
10,446
Posted By ctsgnb
TODAY=$(date +"%b-%d" | sed 's/-0/--/')
TODAY=$(date +"%b-%d" | sed 's/-0/--/')
3,821
Posted By Perderabo
Try changing that line:filelist=$(find ./inform...
Try changing that line:filelist=$(find ./inform -name \*.txt -print | tr '\n' ' ')
3,821
Posted By neutronscott
Must be DOS formatted. I had a line in there for...
Must be DOS formatted. I had a line in there for testing, you can remove the "echo $filelist"


YESTER=`TZ=aaa24 date +%b"-"%d`
filelist=$(find /export/home/gen/links/inform -name \*$YESTER...
5,447
Posted By ctsgnb
Then just enclose the coma in double quote : ...
Then just enclose the coma in double quote :

nawk '/^LOCATION:/{x=$0}x&&/unknown/{print x","$0;x=z}' infile
5,447
Posted By fpmurphy
#!/bin/ksh93 while read line do if [[...
#!/bin/ksh93

while read line
do
if [[ $line =~ 'LOCATION' ]]; then
location=$line
fi
if [[ $line =~ 'unknown' ]]; then
echo "$location,$line"
fi
done < file
5,447
Posted By ctsgnb
the code nawk...
the code
nawk '/^LOCATION:/{x=$0}x&&/unknown/{print x,$0;x=z}' infileshould still work ... or do you expect another output ???
Showing results 1 to 12 of 12

 
All times are GMT -4. The time now is 11:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy