script unix which accept two arguments


 
Thread Tools Search this Thread
# 1  
script unix which accept two arguments

does anyone can help me with this homework, please..I am beginner in linux and I don't how to do it Smilie

Create a script scanner.sh which will accept two arguments: the first argument is the DNS name or the IP address of a system, or a network address or an IP range, the second argument is optional and can be a port number or a port range (if is missing the entire port range will be used).
The application will have an integrated help (-h or --help option) and will verify the validity of the arguments warning the user if an argument is incorrect. The script will try to establish tcp connections (using telnet) to check if the ports are open, and will list on the screen for each scanned system the opened ports.
Specialized applications are not allowed to be called inside the script (applications like nmap).
# 2  
We have homework rules for the homework forum, which you didn't post in and didn't follow. Please post in the homework forum following the homework rules. We can't help you until you do.
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #927
Difficulty: Medium
32-bit versions of the Unix time stamp will cease to work at 03:14:08 UTC on Tuesday, 19 January 2038.
True or False?

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Accept data from file or stdin in script

I have a script that looks like this:sed -f myfile.sed $1 > $1.out called myscript and would like to change it so the parameter isn't necessary: ls *.idx | myscript | xargs some_command What do I need to add so it can run either way? TIA ---------- Post updated at 09:41 AM ----------... (1 Reply)
Discussion started by: wbport
1 Replies

2. UNIX for Dummies Questions & Answers

UNIX script can accept 1 to n parameters

Just for my leaning purpose, I appreciate if someone answer my question: A UNIX script can accept 1 to n parameters. For each of these parameters, write out the parameter id number and its value. (1 Reply)
Discussion started by: shumail
1 Replies

3. Homework & Coursework Questions

Make a file accept only two arguments from the command line

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: 1) The script is executed in the Korn shell. 2) Name the shell script file is asg6s. 3) The asg6s file is... (7 Replies)
Discussion started by: ProgMan2015
7 Replies

4. Programming

Make a file accept only two arguments from the command line

DELETED (2 Replies)
Discussion started by: ProgMan2015
2 Replies

5. Shell Programming and Scripting

passing arguments to unix command or script inside tclsh

hi everobody kindly consider the following in tclsh I understand that we can do the following %exec UnixCmd arg1 arg2 but if I assinged the arguments to a list insde tclsh how can I use them back i.e %set ArgList %exec UnixCmd %exec Unixcmd $list %exec all the... (1 Reply)
Discussion started by: Blue_shadow
1 Replies

6. Shell Programming and Scripting

How to accept arguments in shell script when calling in perl

I have a shell script like this: #!/bin/sh $PYTHON MetarDecoder.py < ../data/mtrs/arg1/arg2 And I'm calling it with this in perl: my $output = `./metar_parse.sh --options`; It's successful when I put in actual values for arg1 and arg2 in the shell script, but I'd like to pass arguments... (1 Reply)
Discussion started by: civilsurfer
1 Replies

7. Shell Programming and Scripting

ksh script that will accept arguments

Hi, I am not very skilled using ksh scripts. How do I create a ksh script that will accept arguments and use them in the script ? I need to make this: Run this command with this argument: ./mykshprogram.ksh madsen and sometimes I need to do this: Run the ksh again with 2... (3 Replies)
Discussion started by: hasselhaven
3 Replies

8. Shell Programming and Scripting

Writing Unix script to accept arguments

Hi, This may be answered elsewhere but I wasn't entirely sure of the wording I should use to search so here we go with an attempt: I wish to make a script that will allow commands to be passed to it such as: <command> -oOPTIONS -aANOTHER -pRINT etc However I don't really know the... (3 Replies)
Discussion started by: stuaz
3 Replies

Featured Tech Videos