10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Heays
So i have that script to which i'd like to pipe (rather than just regular arguments) some data from another virtual output command.
Simplified:
echo * | script.sh
When i know how many args i expect, i can handle this simple by:
&& \
read ONE TWO && \
set ONE TWO
echo "$1 : $2... (7 Replies)
Discussion started by: sea
7 Replies
2. Shell Programming and Scripting
Hi,
I need to get input arguments, as well as validate them. This is how I'm reading them:
#!/bin/bash
args="$@" # save arguments to variable
## Read input arguments, if so
while ; do
case $1 in
-v | --verbose ) verbose=true;;
-z | --gzip ) compression="gz";;
... (3 Replies)
Discussion started by: AlbertGM
3 Replies
3. Shell Programming and Scripting
I am developing a script where 3 other scripts are included.
This is a graph related script.
COMPLETE IDEA:
-There are 3 different graph scripts. I would like to create a master graph with all 3 in one.
-User chooses the type of graph
-User is asked to enter the required auguments (... (7 Replies)
Discussion started by: newkid.7955
7 Replies
4. Shell Programming and Scripting
I am new to schell scripting . My objective is to write a ksh shell script that performs following tasks: -
1. Script reads all command line arguments (arguments are file names) and checks if it contains charachters "abc" in it.
2. If it contains "abc" it will execute a binary file xyz <command... (3 Replies)
Discussion started by: acmilan
3 Replies
5. Programming
I have the following piece of code. Currently the command line arguments are passed as shown below using the "= "sign. I capture the name of the argument, for example vmod and it's corresponding user parameter which is jcdint-z30.cmd.
./raytrac vmod=jcdint-z30.cmd srFile=jcdint.sr
Now I want... (12 Replies)
Discussion started by: kristinu
12 Replies
6. Shell Programming and Scripting
I have trouble getting this logic to work
#!/bin/bash
function assign_var(){
while
do
read -p "$2 :" $3
done
}
assign_var '$IPADDRESS' ipaddress IPADDRESS
Basicly, i want to make sure that entry is made (i can add more sophisticated checks later), but the idea is to recycle... (11 Replies)
Discussion started by: serverchief
11 Replies
7. Programming
Hello everybody,
I'm coding a program in C and i'm getting troubles with this.
I need to read a config file and store the arguments into individual variables, let's say the config file looks like the following:
#This is the configuration file...
192.168.0.1 A1:B1:C1:D1:E1:F1
192.168.0.2... (2 Replies)
Discussion started by: semash!
2 Replies
8. Shell Programming and Scripting
Hi, Guys
I am new to shell programming and just get stuck with one simple question. please kindly help.
According to the tutorial here, we can do something like
for NODE in "ABC 10" "EFG 20"
do
set -- $NODE
echo "letter is $1, number is $2"
done
And the result will... (3 Replies)
Discussion started by: yuanli
3 Replies
9. Shell Programming and Scripting
In the make file
update updateq:
-------------------
----------
i want the makefile to display some messages when user gives "make update", but totally quite wehn user enters "make updateq". Can u tell me how to read these argument in makefile.
$1 doesnt work:( (3 Replies)
Discussion started by: vikashtulsiyan
3 Replies
10. Shell Programming and Scripting
I am writing script in c shell and using this script to read the command line arguments, but it is not working. Pl. someone let me know what is the problem.
#!/bin/csh -f
if ($#argv <> 2) then
echo "you must give exactly two parameters"
else
set name1 = $argv
... (1 Reply)
Discussion started by: skumar11
1 Replies