grep, sed, awk or tr or all Need help on Trying to convert something.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers grep, sed, awk or tr or all Need help on Trying to convert something.
# 1  
Old 07-23-2010
grep, sed, awk or tr or all Need help on Trying to convert something.

THIS is the output i Get i want to take out most of the banner and such and leave ------ down to ------ with fields right it doesnt seem to ouput right im not sure how to delete the $ characters because shell sees them .....


thansk


or even something that make it looks better to understand and maybe put the values to the left if possible haha ....






heres my current configs ....




thanks again

Last edited by ritztech; 07-24-2010 at 01:37 PM.. Reason: code tags, please...
# 2  
Old 07-23-2010
Try this:
Code:
<command> |
awk '/--/ && !f{f=3}
f>0{print substr($0,14)}
/--/{f--}'

# 3  
Old 07-23-2010
wowsers that actually worked ill have to study the awk meaning of it. (substr($0,14)

But for sites that dont work or are down

haha

theres just one more thing im trying if i cant gain access to a paticular modem i get this output.

send: spawn id exp6 not open
while executing
"send -- "1234\r""
(file "/usr/local/bin/modem/chkusrs.exp" line 7)

Users active on the modem



is it possible to remove it being it has the master passwd showing to everyone and if so can i translate it to....


echo "Unable to connect to $a: site maybe unreachable. Check correct ip in iptable sheet"



i have this right now but no luck haha (a couple of grep -v s haha)

out=`/usr/local/bin/modem/chkusrs.exp $ip | grep -v spawn | grep -v send | grep -v file|

But im not sure if im in the right place.


thanks again
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sed/awk command to convert number occurances into date format and club a set of lines

Hi, I have been stuck in this requirement where my file contains the below format. 20150812170500846959990854-25383-8.0.0 "ABC Report" hp96880 "4952" 20150812170501846959990854-25383-8.0.0 End of run 20150812060132846959990854-20495-8.0.0 "XYZ Report" vg76452 "1006962188"... (6 Replies)
Discussion started by: Chinmaya Kabi
6 Replies

2. Shell Programming and Scripting

Grep/awk/sed help

got a file as y.txt 1 abc,def,ghj 2 defj,abc.kdm,ijk 3 lmn,cbk,mno 4 tmp,tmop,abc,pkl 5 pri,chk,cbk,lmo 6 def,cbk.pro,abc.kdm i want to search in the above file the key word like abc looking for two outcomes by passing the parameter value as abc into function and the two outocmes are... (6 Replies)
Discussion started by: silgun
6 Replies

3. Shell Programming and Scripting

awk or sed - Convert 2 lines to 1 line

Hi, Just trying to get to grips with sed and awk for some reporting for work and I need some assistance: I have a file that lists policy names on the first line and then on the second line whether the policy is active or not. Policy Name: Policy1 Active: yes Policy... (8 Replies)
Discussion started by: guinch
8 Replies

4. UNIX for Dummies Questions & Answers

grep/awk/sed?

Thread1 { x = 2 y = 10485 } Thread2 { x = 16 y = 1048 } Thread3 { x = 1 y = 1049 } Thread4 { x = 4 y = 1047 z = 500 } Suppose the above is a piece of code. I need to automate and verify that the value of x under Thread1's 2. There are several... (3 Replies)
Discussion started by: foxtron
3 Replies

5. UNIX for Dummies Questions & Answers

How could i get this by sed or grep or awk ????

------------------------------------------------------------------ Ex of Warning messgae,(Many similar lines occure for Both Test and Test1) -WARNING:Below Field not implemented in file File name: /home/test/ new/file1, msg buffer is: :Test:000948 ... (1 Reply)
Discussion started by: prsam
1 Replies

6. UNIX for Dummies Questions & Answers

Grep Sed or Awk?

I have two .txt files one called good.txt and the other one is called bad.txt. Both contain email addresses in the following format: john@john.com bob@bob.com sarah@sarah.com Basically, I want to scrub good.txt against bad.txt and save the resulting output in scrubbed.txt meaning that if... (2 Replies)
Discussion started by: holyearth
2 Replies

7. Shell Programming and Scripting

Sed | Awk | Grep

Can someone help me in understanding when to use SED, AWK and GREP (3 Replies)
Discussion started by: kn.naresh
3 Replies

8. Shell Programming and Scripting

sed or awk to convert text files with recurring headings to rows and colum

I have many text file reports generated by a Information Assurance tool that I need to get into a .CSV format or Excel tab delimited format. I want to use sed or awk to grab all the information in the sample text file below and create column headings:Risk ID, Risk Level, Category, Description, How... (5 Replies)
Discussion started by: Bjoeboo
5 Replies

9. Shell Programming and Scripting

need help!!!awk,grep,sed

hi all by using cat /etc/passwd I've got these output. ajh1ect:x:839:501:Anthony:/home/ajh1ect:/bin/bash mjb1ect:x:840:501:Michael:/home/mjb1ect:/bin/bash mv3ect:x:841:501:Marian:/home/mv3ect:/bin/bash now I want to see just the user ID and group ID. so what is the code will be with... (2 Replies)
Discussion started by: nokia1100
2 Replies

10. Shell Programming and Scripting

How to convert grep to sed??

Hi, I am hing problem in grep.. So I need convert following code to sed based one.. grep -ie "error|exception" $LOG_DIR/Node$i\Log.txt >> $LOG_ERR_REP thats is I want to serach error and exception (ignore case) and write to other file . how to do? (5 Replies)
Discussion started by: redlotus72
5 Replies
Login or Register to Ask a Question