Reference no: EM132644234
Linux Programming for Admin Assignment topic: Passing command line arguments. Provide the scripts as it would appear in the linux terminal.
A.Create a bash script named args1.sh.
When executed, it write the following, to standard out.
./args1.sh Iowa California Nebraska
There were 3 arguments passed
All the arguments are Iowa California Nebraska
The number of characters in Iowa is 4
The number of characters in California is 10
The number of characters in Nebraska is 8
The first characters are I, C, and N.
Two characters starting at offset 0, for Iowa are "Io".
Four characters starting at offset 2, for California are "lifo".
Five characters starting at offset 3, for Nebraska "raska"
B.Create a bash script named args2.sh.
When executed, it write the following, to standard out.
Note that spaces have been added.
./args2.sh Iowa California Nebraska
The first characters are I, C, and N.
C.Create a bash script named args3.sh.
When executed, it writes the following, to standard out.
Note that what is passed, in now double quoted.
./args3.sh "Iowa California Nebraska"
The first characters are I, C, and N.
TODO_2 net1.sh
Create a bash script, named net1.sh, that writes only the network of the IP addresses passed.
Assume a subnet mask of 255.255.0.0
./net1.sh router 10.1.0.3 firewall 10.2.0.4
The router is on network 10.1
The firewall is on network 10.2