Search Results

Search: Posts Made By: beinthemiddle
2,844
Posted By alister
If all you want are sections whose first line...
If all you want are sections whose first line begins with "ftp" and whose last line begins with "send":
sed -n '/^ftp/,/^send/p'

Regards,
Alister
2,844
Posted By Franklin52
With awk: awk '/ftp/ || /user/ || /send/' file
With awk:
awk '/ftp/ || /user/ || /send/' file
2,844
Posted By rujuraha
Here is the code cat filename | awk ' /ftp...
Here is the code
cat filename | awk '
/ftp SERVER/{ print $0;
i = 1;
while ( i < 3 )
{ getline;
print $0;
i++;
...
2,844
Posted By dr.house
Maybe: [house@leonov] grep -A 2 '^ftp '...
Maybe:


[house@leonov] grep -A 2 '^ftp ' data.file
ftp SERVER
user UNAME PASS
send FILE_TO_BE_SENT
--
ftp SERVER1
user USER1 PASS1
send FILE_TO_BE_SENT_1
2,844
Posted By clx
How many keywords do you have? If they are not...
How many keywords do you have?
If they are not more,

$ egrep '^ftp|^user|^send' file
ftp SERVER
user UNAME PASS
send FILE_TO_BE_SENT
ftp SERVER1
user USER1 PASS1
send FILE_TO_BE_SENT_1
$ ...
Showing results 1 to 5 of 5

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