LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-06-2007, 03:58 AM   #16
Manana
Member
 
Registered: Dec 2005
Distribution: Ubuntu,Debian
Posts: 41

Original Poster
Rep: Reputation: 15

Thanks for all the time your putting into this colucix!

Hmm but the thing is if i change the awk cmd to end before where it usually ends like this :

exec cat /conf/$USER/$port/.tmpconfig | awk "/!/,/interface/" > /conf/$USER/$port/$namn.txt

Now it should if its working ok end at the first occurence of interface wich is above where it usually finishes.

I still get the excact same output with this line as with my ordinary one.
This is whats telling me that its the awk format thats faulty.
The .tmpconfig isnt removed at all, i can look at it after the script is done with all the output from the session in it.
 
Old 02-06-2007, 04:25 AM   #17
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
This is very strange! Have you checked that the output you're looking at has been modified after the execution of the modified command (with interface instead of end)? Sorry for the silly question, but I'm trying to figure out what really happen!
By the way, here is an alternative (and more pedantic) awk command (just to have a proof of the correct awk processing)
Code:
exec cat /conf/$USER/$port/.tmpconfig | awk "BEGIN {toprint=0} /!/{toprint=1} /end/{print \$0 ; toprint=0} {if (toprint!=0) {print \$0}}" > /conf/$USER/$port/$namn.txt
 
Old 02-06-2007, 04:58 AM   #18
Manana
Member
 
Registered: Dec 2005
Distribution: Ubuntu,Debian
Posts: 41

Original Poster
Rep: Reputation: 15
Yea i checked that and its all ok.

Still the same with the new awk line, getting really frustrated here!

Maybe i could call an external bashscript from the expect script wich excecutes the awk cmd? How would that look?
Probably a little hacky but as long as it works.

When i run the script, and do the "show running-config" on the router it kinda pauses excactly where the break is, thats gotta be the problem
but since i get the whole output in .tmpconfig and the awkline is last in the script im thinking it should work anyway!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set the regulatory daemon to restart when I restart the network service? zahadumy Linux - Networking 0 11-05-2006 11:24 AM
How can i make a restart to the pop3 of my server? YaronB15 Linux - Newbie 1 11-03-2006 09:40 AM
What do you do after all is finished mdkusr General 12 01-29-2006 11:44 PM
finished new installation DanoL Linux - Newbie 2 05-03-2004 08:39 PM
i just finished typing "./configure" and "make" in mplayer directory... kublador Linux - General 4 02-22-2003 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration