!/bin/bash
NETWORKS='çat networks.txt'
for NETWORK in $NETWORKS
nmap -sn -oN /root/Desktop/$NETWORK
done
echo "Finished!"
The networks.txt file has my list of network addresses I want to scan. If I enter a single IP address, like 1.2.3.4, the script works fine and the outpu file is named 1.2.3.4.nmap. But when I enter a network address, like 1.2.3.0/24, script errors off saying it cannot open file /root/Desktop/1.2.3.0/24 for writing. This error tells me the script is at least SEEING the right information in the txt file it's just not processing it properly. If I put single ' marks around $NETWORK so that it reads /root/Desktop/'$NETWORK' the script runs and the output file name is $NETWORK and not 1.2.3.0/24.
Is there a way to associate each network address by a number instead of a name and reference that number? Like:
Code:
#1 1.2.3.0/24
#2 2.3.4.0/24
So I would code the script to take the network address and save it in a file name by its associated number (#1.nmap, #2.nmap, etc.)
Hi all,
I'm new in linux. When I try to run a bash script, it doesn't execute and i receive the following error message
20070321:220002|ERROR||exportDatabase.bash|Another EXPORT process (pid=2799) is still running.
If i kill this pid, i receive "No such process".
This process was running... (5 Replies)
I have wasted one working day writing this scripts.
It compares two folders and make a good tabbed report about their differences.
#!/bin/bash
function DRAW_DEPTH () {
ROUND=$1
while
do
printf %s " "
ROUND=`expr $ROUND - 1`
done
printf %s "|- "
}
function MAIN () {... (9 Replies)
Hello,
Is there some way to validate a bash script before running it. I want to make sure all of the syntax and everything is good so that I dont get a false return code.
Thanks,
tom (7 Replies)
Hey guys, so I've been trying to write a bash script called runSorter.sh that runs an executable that also takes in some parameters and outputs the results to a text file. The executable, sorter, takes in a number parameter. I want to make it so that you can input as many number parameters into... (4 Replies)
Hey guys, so I wrote a small script that pretty much just takes in two numbers and counts from the first to the second, e.g.
unknown-hacker|544> count.sh 1 3
1
2
3
My problem is I want to make it so that if you input invalid parameters, such as non-numerical characters, more than 2... (2 Replies)
I'm a bit new to bash programming and I was assigned the job of writing a script that will check to see if a program server is running and to restart the program if it is not up. The script is supposed to check the program every hour (which I have looked up and I believe I know how to do) and send... (3 Replies)
hi guys
we've had nagios spewing false alarm (for the umpteenth time) and finally the customer had enough so they're starting to question nagios. we had the check interval increased from 5 minutes to 2 minutes, but that's just temporary solution. I'm thinking of implementing a script on the... (8 Replies)
Hello UNIX & Linux Forums community! Long time Linux daily user hobbyist, new to shell scripting....
I'm working on a script that does all the "work" in one script, and makes calls to a second script to display info to the user via mostly expanding variables in heredocs.
I'm contemplating... (6 Replies)
Discussion started by: Cody Learner
6 Replies
LEARN ABOUT DEBIAN
pconf_detect
libprinterconf(6) Games Manual libprinterconf(6)NAME
pconf_detect - A command-line utility for autodetecting printers in Linux
SYNOPSIS
pconf_detect -m [PPORT|NETWORK] -i <info-string>
DESCRIPTION
pconf_detect is a command-line utility for autodetecting printers from Linux. It is a simple wrapper around libprinterconf's
pconf_detect_printer() function. It currently supports two methods of autodetection: parallel port detection and network detection.
The detection type is specified with the -m option, which can be followed by one of two values: PPORT or NETWORK. Detection specific
information is passed following the -i option. For parallel port detection, this will be a comma-separated string of parallel port numbers.
For network detection, it will be some method of specifying a range of hosts or IP addresses.
The most common form is "10.203.1.2/24", indicating the IP/bitmask to scan.
Other formats include an IP range ("10.203.1.12-30"), an IP/netmask ("10.203.1.2/255.255.255.0"), a simple IP address ("10.203.1.2"), or a
host name ("myprinter.mydomain.com").
[Note: Detection of large network subnets can take a significant amount of time.]
pconf_detect will print out a set of formatted text strings, one for each detected printer.
The actual format of these strings will depend on the detection method. For parallel port detection, the string will be in the basic form:
"port=p;model=m". For a network printer the form is: "printer=hostaddr;vendor=v;model=m".
EXAMPLES
PPORT example:
pconf_detect -m PPORT -i 0,1
where "0,1" is a comma-separated list of the parallel port to scan.
NETWORK example:
pconf_detect -m NETWORK -i "10.203.1.2/24"
where "10.203.1.2/24" is the IP/bitmask to scan.
SEE ALSO libprinterconf(3)Printerconf Docs 12 April 2000 libprinterconf(6)