12-06-2008
#!/bin/ksh
i=`date +%d`
sed `/WARNING:Below field is not in File name/{N/\n/d}' load.$i >> load_new.txt
Using ur script i gave lik above but i am getting the following error,
-----------
/WARNING:Below: not found
-----------
I am seraching for "WARNING:Below field is not in File name" in load.<current day> and the next line of it and then redirecting tat o/p to load_new.txt
coul u please help me out?
Last edited by prsam; 12-06-2008 at 03:19 AM..
Reason: left the word "next line"
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
problem String
~~~~~~~~~~~~~~~~~~
icecream= { smart peopleLink "good" LC "happy" ,
smartpeopleLink "dull" LC "sad" }
aend = {smart vc4 eatr kalu}
output needed
~~~~~~~~~~~~~~~~~~
smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad"
smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies
2. UNIX for Advanced & Expert Users
Hi All,
I'm trying to find a command like similar to "touch" which would let me change the file size property.
For ex: I have a file of size 1MB using the command i would like to set/update the size something like 1KB.
Is it possible? Is there any such command which would accomplish this... (3 Replies)
Discussion started by: sriharshareddyk
3 Replies
3. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
4. Shell Programming and Scripting
Hi,
I don't know hot to make this command work:
ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt"
It should return the list of file .txt
It's important to search .txt at the end of the line, becouse some file name have "txt" in their name but have other extensions (13 Replies)
Discussion started by: DNAx86
13 Replies
5. AIX
AIX 4.2
I am trying to do an rsh grep to search for date records inside server logs by doing this :
xx=`date +"%a %b %d"`
rsh xxx grep "^$XX" zzz
gives :
grep: 0652-033 Cannot open Jun.
grep: 0652-033 Cannot open 11.
But if I do :
xx=`date +"%a %b %d"`
grep "^$XX" zzz
it works... (2 Replies)
Discussion started by: Browser_ice
2 Replies
6. Shell Programming and Scripting
Hi all,
can any one suggest me the script to grep multiple strings from ps -ef
pls correct the below script . its not working/
i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK.
bash-3.00$ ps -ef | grep blu
lscpusr 48 42 ... (11 Replies)
Discussion started by: steve2216
11 Replies
7. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
8. Shell Programming and Scripting
I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank).
In a first approach I coded:
find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt
But this doesn't work. I got an error (under Ubuntu):
grep:... (5 Replies)
Discussion started by: pstein
5 Replies
9. Shell Programming and Scripting
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies
10. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
LEARN ABOUT DEBIAN
newinclude
newinclude(1) General Commands Manual newinclude(1)
NAME
newinclude - create a binary mailing list from an :include: file
SYNOPSIS
newinclude list
DESCRIPTION
newinclude reads a sendmail-style :include: file, list, and converts it into a binary format in list.bin for use by fastforward.
newinclude first writes the mailing list to list.tmp, and then moves it to list.bin. If there is any problem creating list.tmp, newinclude
leaves list.bin alone.
newinclude always creates list.bin world-readable.
COMPATIBILITY WARNING: sendmail reads list directly; fastforward needs list.bin. sendmail's strategy is a disaster if you save list to
disk at the same moment that sendmail reads it; the list will be truncated at a random spot, perhaps in the middle of an address. Further-
more, if the system crashes while you are writing list, list could be filled with all sorts of garbage.
LIST FORMAT
list may contain any number of lines; each line may contain any number of addresses or further :include: files. See newaliases(1) for
details on the address format. Any line in file beginning with # is ignored.
COMPATIBILITY WARNING: newinclude does not support file or program deliveries in :include: files. You can use the secure delivery mecha-
nisms described in dot-qmail(5) instead.
COMPATIBILITY WARNING: Versions of sendmail before V8 did not allow comments in :include: files.
SEE ALSO
fastforward(1), newaliases(1), setmaillist(1), dot-qmail(5)
newinclude(1)