@mikrom Thank you so much!! That is exactly what I was after.. tested and working 100% fine [bigsmile]
Brilliant solution.. and I love it! :-)
[thanks2]
Hi All,
Which is the best method for me to handle this? I'm thinking awk might be the way to go perhaps, but not sure where to start even. I have a text file, which contains IP addresses and ranges as per this example:
10.10.115.69
10.10.128.6 - 10.10.128.7
10.10.128.20
10.10.128.28...
Hi All,
Probably a simple one, but I'm not understanding why this isn't working the way I expect it to work:
AB="level20"
echo "filename50.cfg,$AB" | awk -F. '{print $1","$AB}'
Output:
filename50,filename50.cfg,level20
I'm expecting output to be:
filename50,level20
I'm confused... might...
@tmd1332 .. recently one very simple one stumped me wasting hours.
Probably not related to your problem, but you never know lol .. jump down to '20 Nov 13 15:47' on this one that tripped me up (once again) http://www.tek-tips.com/viewthread.cfm?qid=1721210
@SamBones yeah, I've used the dos2unix on occasion, but 99% of the time I never need it. This one caught me out once again lol
@PHV, man, you're still kicking about! :-) ... Nice one.. I didn't know about that awk search feature, thanks for that. I'll give it a try and probably find it improves...
UPDATE: Thought I best come back and mention that I only found time to work on this one again today. Took me a few minutes to see the problem, only once I vi'd my source data and noticed that at every line with a (fc1) ended with the mangey (ctrl-v M) ^M character. [evil]
A quick sed replace on...
Sorry SamBones, but you're quite right in spotting that .. I was typing it out to keep it simple instead of copy and paste the mess I've chucked together [tongue]
I'm using bash, got 100's of similar scripts working fine .. just this one has me stumped. I'll get back on the system this weekend...
Hi All,
Wasted enough time on this so hopefully someone can tell where I'm going wrong here. Such a simple problem, but it's doing my head in!
I'm catching some data into variable VAR, looking to see if it contains (fc1) .. if so echo string and do something else if matches it.
I've tried both...
Thanks bnorton916
The command was printed to the screen, a copy and paste to the command line did nothing, so I expect the ipRouteDest command is not supported by the Cisco device.
#/usr/bin/snmpwalk -v 1 -c private=string router1 ipRouteDest
#
If I run the command without the ipRouteDest I...
Hi all
I'm trying to understand why this snmp script is not working, not sure if its the actual script that is the issue as I'm not clued up in perl really (or snmp for that matter).
Figured as I'm trying to do this using SNMP this might be the best place to ask.
Original code is grabbed and...
Hi All
I'm trying to get a perl script to work that I found in a Cisco Cookbook. My knowledge of perl is very limited so I'm not sure what the issue is and digging around the net is not helping me much.
The script from...
Hi
Does anyone have a good explanation on how the IOS levels, trains work? I'm looking into various IOS levels along with vulnerabilities and sometimes I get confused as to whether or not a level is actually vulnerable.
Take this for example. If a device is running "124-6.T7" version of IOS...
Hi All
I'm stuck on something and not sure what the problem is. This should be basic stuff but I'm not getting it to work.
All I want to do is run a small shell script against a file to test if the numbers match up. If they do, print PASS or if not FAIL.
The file I want to run against...
Thanks PHV - works 100% that :-)
Thanks all for the help as usual .. one day all these bits and pieces of puzzling bits will fall into place in my head hehe.
Cheers... T
Hi chaps
Thanks both for taking the time to help and explain this one for me :-)
I've tried both examples you provided. Annihilannic one replaced the word password with X's
And Feherke's one replaced some of it exactlly as described it would.
The thing is, that whole string is the actual...
Never mind ... I figured out the voting issue. Window was open and hidden under the piles of other ones hehe.
However, I've been thinking of using the above line in another area for another file containing passwords.
I applied the following to my test file:
sed '/password/s/[0-9 A-Z-]*$/...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.