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...
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...
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...
Hi all,
This is probably simple but for some reason I'm struggling to find an answer.
I'm hoping to use sed to replace a random string in a file that matches a string with something else.
Example, in the file.txt it contains various lines of text and also the lines I wish to change:
text...
Hi all
I thought this would be easy to find but its proving harder than I thought.
I'm running a bash shell script that calls and expect script, problem is, when it calls the script it displays the output to the screen which I don't want. Its a login sequence of sorts and would like it to...
Hi all,
I need another set of eyes and brains to explain why I can't get this working. If could be a simple case of bracket problems which always catch me out ;-)
I have a file called main.txt which I run the script against. The script is meant to check if certain lines of text appear in the...
Hi all,
This one has me stumped. I need to include the following type of test into a script and have it request and input a value should it equal a zero for example.
I couldn't get it working in a while loop, but as soon as I change it to a for loop then it works as I want it to. :-S
Contents...
Hi all,
I've tried to search the forums for a way to do this. The simple script bellow might explain more or less what I'm trying to do:
A="Option A - Value is less than or equal to 500"
B="Option B - Value is more than 501 but less than 5000"
C="Option C - Value is more than 5001"
if [...
Hi all,
I've hit a blank and am not sure how to get around this. (Let alone explain it properly ;-) … I’ll try my best)
I tried searching the forums but found nothing that seems to match what I’m wanting to do.
It’s like this. I have a bunch of directories which I want to ls -lt on and awk...
Hi,
I've searched the boards and not finding the answer to my problem. I'm probably using the wrong keywords ;-)
Anyhow, here's an example of the problem. As an example, I have a file which contains the following:
entry0/1
blah blah blah
#
entry0/12
other blah blah stuff
#
entry2/10
boring...
Hi all,
I'm having a small problem which I'm struggling to find answer to. My main problem is adding two (or more) lines under a certain line in a file.
To keep it a straight forward example as possible, I have a file called "sample.txt" which contains lines as follows:
entry 1/1
entry 2/1...
Hi,
Does anyone know why DHCP doesn't work for IP addresse ranges that are configured as the secondary IP address.
Making the secondary range the primary solves this, but then the "new" secondary range doesn't work any longer.
Any ideas why this is so?
Thanks .. T
Hi All,
I have some hand me down expect scripts that I've been responsible for the past few years. They all have the following at the end of them:
for {} 1 {} {
expect eof {
exit
}
}
Anybody able to explain exactlly the purpose of this?
The expect scripts are usually called from...
Hi,
I need to perform checks against two files. I've searched the boards but have not found a simple solution.
Ideally I need to compare the files and have the output show whats missing or extra in one and visa versa. I thought this would be nice and simple using diff , but its proving...
Hi,
I rasied this problem of mine in another forum but never got an answer as yet.
My problem is, how do I get away with using a variable in sed that contains a slash as in the following example:
var1="ethernet0/0"
sed -n '/$var1/,/whatever/p'
PHV helped me out with another sed...
Hi all,
I'm trying to hash out certain entries in socks.conf files on a few unix boxes .. I thought a simple script that would go to each box, check the file for any entries that had the following type string: sockd @=blah.at.me 0.0.0.0 0.0.0.0 eq whatever and would then pop a hash in the...
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.