Search Results

Search: Posts Made By: type8code0
6,674
Posted By RudiC
How about (untested):while read IP do echo...
How about (untested):while read IP
do echo "Test proxy $IP"
curl echoip.net --proxy "IP"
done < proxy-list.txt?
6,674
Posted By pilnet101
Have a read up on "while loops" in shell...
Have a read up on "while loops" in shell scripting. This should achieve what you are after.
1,549
Posted By Scrutinizer
You're welcome... You could adjust the shell loop...
You're welcome... You could adjust the shell loop like so, leaving out the first input file and reading from the terminal instead..
while
printf "Enter new group name : "
read service_group...
1,549
Posted By Scrutinizer
With awk you could try something like this: awk...
With awk you could try something like this:
awk 'NR==FNR{A[$1]; next} {print s, $1; for(i in A) print s, $1, t i}' s="create service_group" t="'' services:tcp" file2 file

But perhaps shell script...
1,549
Posted By Chirel
Hi, maybe this could work for you. awk ' ...
Hi, maybe this could work for you.


awk '
BEGIN { print "create service_group TEST"; }
{ print "create service_group TEST \x27\x27 services:tcp"$1 }' port.txt
4,550
Posted By RudiC
To remove the /nn, replace printf "%s/%s" $A $B ...
To remove the /nn, replace printf "%s/%s" $A $B by printf "%s" $A
For the reverse operation, trywhile IFS=" ." read -a VAL
do N=0
DL=( . . . / )
for...
9,819
Posted By Corona688
Bumping up posts or double posting is not...
Bumping up posts or double posting is not permitted in these forums.

Please read the rules (https://www.unix.com/misc.php?do=cfrules), which you agreed to when you registered, if you have not...
4,550
Posted By Corona688
My original solution, from your original thread,...
My original solution, from your original thread, still does exactly what you say you want. Did you ever try it?

#!/bin/bash

while IFS="/" read IP S
do
M=$(( 0xffffffff ^ ((1 <<...
4,550
Posted By RudiC
This task is almost impossible in awk as it...
This task is almost impossible in awk as it doesn't have bit operations. But, in (recent) bash, you could try this:while IFS="/" read A B
do DL=$'\t'
printf "%s/%s" $A $B
...
4,550
Posted By junior-helper
There is a syntax error in the above code: The...
There is a syntax error in the above code: The quote in front of $1 is superfluous.
Apart from that, in this particular case (input file contains only one column) the above code is essentially the...
4,550
Posted By RavinderSingh13
Hello type8code0, Following may help you in...
Hello type8code0,

Following may help you in same.

awk -F"/" '{sub("8","255.0.0.0",$2);sub("16","255.255.0.0",$2);sub("24","255.255.255.0",$2);print}' Input_file


Output will be as...
8,562
Posted By junior-helper
Yes. E.g. #!/bin/bash awk '{ print...
Yes. E.g.
#!/bin/bash

awk '{
print "host"$1" "$1;
}' host.txt > output-1.txt

awk '{
print "create host_plain " $1;
print "modify network_objects "$1" ipaddr " $2;
print "update...
9,819
Posted By Corona688
What's your shell? What's your system? CIDR...
What's your shell? What's your system?

CIDR to netmask is straightforward if tedious -- just binary math. Shells aren't generally that good at it but modern BASH has large enough numbers to...
8,562
Posted By sea
Does this do what you want? IPS=$(echo...
Does this do what you want?

IPS=$(echo 1.1.1-{1,3,5})
OUT=$HOME/tmp/output-final.txt

for IP in $IPS
do
echo "create host_plain host $IP
modify network_objects host$IP ipaddr $IP
update...
8,562
Posted By RudiC
Try to extend your second script:awk ' ...
Try to extend your second script:awk ' {print "create host_plain host" $1;
print "modify network_objects host"$1" ipaddr " $1;
print "update...
1,315
Posted By Yoda
awk '{ print "create host_plain " $1; ...
awk '{
print "create host_plain " $1;
print "modify network_objects "$1" ipaddr " $2;
print "update network_objects "$1;
print " ";
}' host_ip.txt > output.txt
1,315
Posted By Yoda
awk '{ print "create host_plain " $1; ...
awk '{
print "create host_plain " $1;
print "modify network_objects "$1" ipaddr " $2;
print "update network_objects "$1;
print " ";
}' host_ip.txt
Forum: Solaris 05-27-2011
26,032
Posted By bartus11
Try this: ping -s google.pl | xargs -n1 -i bash...
Try this: ping -s google.pl | xargs -n1 -i bash -c 'echo `date +"%Y-%m-%d %H:%M:%S"`" {}"'
7,554
Posted By zaxxon
You can try just without out the n: tail -2...
You can try just without out the n:

tail -2 filename
head -2 filename
8,286
Posted By LivinFree
My first guess would be: #! /bin/bash ...
My first guess would be:

#! /bin/bash

logfile=/path/to/logfile
while read ip; do
zgrep "$ip" $logfile > output_logfile_${ip}
done <iplist


It could be done more elegantly, and maybe...
Forum: Solaris 04-20-2008
60,556
Posted By jlliagre
You can save some keystrokes: find . | sed -e...
You can save some keystrokes:
find . | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
Showing results 1 to 21 of 21

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