Re: [Trisquel-users] Syntax problems with nested loops

2020-07-15 Thread amenex
After sitting on Magic Banana's suggested executable script for the near-forever four days, I found the time and concentration to try it. First, I stripped those trailing dots (which facilitated pasting nmap's random 3rd & 4th octets) with the sed script suggested by Magic Banana: sed -i

Re: [Trisquel-users] Syntax problems with nested loops

2020-07-11 Thread amenex
Here's what I was trying to accomplish: Starting with Magic Banana's script: TMP=$(mktemp -u) trap "rm $TMP 2>/dev/null" 0 mkfifo $TMP awk '{ for (i = 0; ++i $TMP & od -A n -t u1 -w2 -N $(expr 1024 \* $(wc -l < "Prefixes.May2020.Slash16.txt")) /dev/urandom | tr -s ' ' . | paste -d '' $TMP

Re: [Trisquel-users] Syntax problems with nested loops

2020-07-11 Thread amenex
Alas, I could not make Magic Banana's script for generating reandomized IPv4 addresses work; most certainly by my failure to comprehend what's going on sufficiently. I tried constructing an od script, but the best I could do was to generate 3rd & 4th octets which violate the 255 maxiumum of

Re: [Trisquel-users] Syntax problems with nested loops

2020-05-01 Thread amenex
About my playing with the end-of-line character (\n) ... Applying nMap's grepable-output function, as in this script: sort TestGrepOutnMapNine.txt | sudo nmap -Pn -sn -T4 --max-retries 16 --script asn-query -iL '-' -oG - | grep "Host:" '-' > TestGrepOutnMapNineGrep.txt eliminates the blank lines

Re: [Trisquel-users] Syntax problems with nested loops

2020-04-30 Thread amenex
Alas, sed won't let me play with the end-parentheses character, even when I'm using it as a handle to select the immediately following newline character and to select where to position the substitute tab: [)n] to be replaced by [)t]. I haven't worked out a suitable adaptation of Magic

Re: [Trisquel-users] Syntax problems with nested loops

2020-04-29 Thread amenex
Magic Banana's magnificent script to fill out the listing of prefixes with random octets looks like this for a specific set of two-octet prefixes: TMP=$(mktemp -u) trap "rm $TMP 2>/dev/null" 0 mkfifo $TMP awk '{ for (i = 0; ++i

Re: [Trisquel-users] Syntax problems with nested loops

2020-04-22 Thread vas1980i
xiferp=$(tail "-n $retnuoc" "SS.IPv4-NLU-January2020-26Prefixes.txt" | head "-n 1") 26 prefixes - add them to an array first, then use foreach loop https://linuxconfig.org/how-to-use-arrays-in-bash-script

Re: [Trisquel-users] Syntax problems with nested loops

2020-04-22 Thread amenex
Following Jaret's contribution, and also restructuring my script according to this link: https://www.linuxquestions.org/questions/programming-9/nested-while-loops-for-bash-novice-4175439318/ !/bin/bash retnuoc=1 counter=1 for (( retnuoc ; retnuoc < 3 ; retnuoc++ )); do for (( counter ; counter

Re: [Trisquel-users] Syntax problems with nested loops

2020-04-22 Thread vas1980i
/bin/sh is not bash It doesn't understand bash's syntax (counter++) /bin/bash is bash in scripts use: #!/bin/bash

[Trisquel-users] Syntax problems with nested loops

2020-04-21 Thread amenex
Here is a script that is intended to generate a series of IPv4 addresses in CIDR/16 address space: counter=1 while [ $counter -le 4096 ] do prefix=185.180; dd if=/dev/urandom bs=2 count=1 2>/dev/null | od -An -tu1 | tr -s ' ' . | sed s/^/$prefix/ >> Temp42120Works.txt ((counter++)) done