Now i tried to remove the array, and shorten it a bit, now it behaves weird.
Even with while IFS="$IFS\l" read ARG there was no difference.
Any ideas please?
(edit: Or should i better stay with the array?)
Not weird at all. Every time through the read loop, set clears all of the arguments you have accumulated. Try something more like:
But, this still won't work if you have an argument that has embedded <newline> characters.
This User Gave Thanks to Don Cragun For This Post:
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)
I have to write a C program using sys call (read, no fread) to read from shell all the parameters, without know how many are them.
I tryed in some ways, but I have no success.
Any Idea?
Can I use read to read from stdin? (1 Reply)
Hi,
What is the maximum number of arguments that could be passed to zsh ?
To find out that I tried a simple script.
And the maximum number of arguments that could be passed turned out to be 23394
#! /bin/zsh
arg=1
i=1
subIndex=23000
while
do
arg=$arg" "$i
i=$(($i + 1))... (9 Replies)
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:
Your script must check for the correct number of arguments (one argument). If somebody tries to invoke the... (1 Reply)
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)
Hello,
I am trying to make a bash script that can pull data from a file and then change one part of said data.
I want to search by username and pull the full line. That way there is a way to replace just one part of that line then return it back to the file.
My Data is stored like:
... (1 Reply)
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)
Hi,
I am having a bit of trouble writing this.
I have the script working if I only use 1 of these but it's not working the way i need it to.
Basically more above the script i may or may not have a 5th variable defined. if i do it does a process before getting to the rest of the script.... (2 Replies)
I need to declare a function, this function will contain a script, this script cannot be in a file but must be piped. and then, for the script to run, i need to pass arguments to it.
everything has to be on one line. so i'm basically looking for a one-liner
here's what i'm doing:
myfunc ()... (3 Replies)
suppose i have a perl script that is normally run this way:
./checkdisk.pl -H hostname -w 40 -c 80
but, for whatever reason, i cannot run the script directly as it should. But i can cat it through pipe. How can i pass the arguments "-H hostname -w 40 -c 80"?
so this is what i'm doing,... (6 Replies)
Discussion started by: SkySmart
6 Replies
LEARN ABOUT DEBIAN
togeomview
TOGEOMVIEW(1gv)TOGEOMVIEW(1gv)NAME
togeomview - send commands or OOGL objects to geomview
SYNOPSIS
togeomview [-c] [-g] [pipename [program args ...]]
DESCRIPTION
togeomview sends a stream of geomview commands, or OOGL-format geometric data, to a cooperating copy of geomview. If geomview is not run-
ning, it is automatically started. ('geomview' must be on the $PATH of the user running 'togeomview' in order for this to work.)
Typical usage is:
someprogram | togeomview (to send commands) or
someprogram-generating-OOGL-data | togeomview -g (to send geometry)
i.e. a program pipes geometric data into ``togeomview''; the data is displayed by a copy of geomview run with the -M option and a name
matching the one given to togeomview.
Togeomview uses a named pipe in the directory /tmp/geomview to communicate with geomview. If unspecified, the pipe's default name is
"OOGL". When sending geometry (-g), a geomview object with the same name as the pipe appears in geomview's object browser.
By default, when no suitable copy of geomview is running, togeomview invokes "geomview" with arguments specifying the appropriate named
pipe. A different command may be specified as in:
togeomview OOGL gv -wpos 300x300 -c my_startup_script
which communicates through a pipe named OOGL, and (if necessary) invokes the given gv command. The pipe name is required if a command is
specified.
After togeomview has created it, the named pipe may be written as an ordinary file. For example, one could use
togeomview pipename < /dev/null
to invoke a listening copy of geomview, and then run a program which simply wrote to /tmp/geomview/pipename.
FILES
/tmp/geomview
BUGS
The pipe-based communications scheme imposes several restrictions.
If no copy of geomview is reading from the pipe, or if geomview gets far enough behind, a program writing data to ``togeomview'' will be
forced to block after sending a few kilobytes.
Because of the buffering in the pipe, the sender may be substantially ahead of the geomview display.
If geomview exits, the sending program receives a write-on-broken-pipe (SIGPIPE) signal, which will kill it unless measures are taken to
catch or ignore that signal.
Only one copy of geomview can read from a given pipe at a time. If a second copy attempts to read from it, both will probably fail. It's
fine to have multiple copies of geomview reading from different pipes.
Note that togeomview will invoke geomview if no extant copy is listening to the relevant pipe; it can't connect to an existing copy of
geomview started by other means.
SEE ALSO geomview(1), oogl(5)Geometry Center 21 May 1993 TOGEOMVIEW(1gv)