Sponsored Content
Top Forums Shell Programming and Scripting Set specific part in command output into variable Post 302225228 by orit on Friday 15th of August 2008 12:39:15 AM
Old 08-15-2008
Set specific part in command output into variable

I am trying unsuccessfully to set into a variable a specific part of command output:
The command output will be as:
line 1: <varied>
line 2: 2 options:
option 1:
Set view: ** NONE **
or
option 2:
Set view: <different_name_of_views_always_without_spaces>

and I would like to get into the variable either the ** NONE ** or the name of the view (<different_name_of_views_always_without_spaces> in option 2).

What is the syntax to find that "field" into my variable?

Thanks a lot
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Export command giving Variable Name vs the Value set for the Variable

I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so: set -a export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data" export... (2 Replies)
Discussion started by: ParNone
2 Replies

2. UNIX for Dummies Questions & Answers

Set a variable from awk output

I have a file which I am processing using awk to spit out the following: export CLIENT=1 ; export USER=1 ; export METABASE=1 ; export TASK=1 ; export TOTAL=3 What i want to do now is execute that within the script so those variables are available to other commands. I've tried piping the... (3 Replies)
Discussion started by: Cranie
3 Replies

3. Shell Programming and Scripting

How to set IFS for a specific command

Hi there, I'm using two commands that need different IFS. The mysql command need IFS to include space because I'm given the mysql command as a variable: supernova:~# cat myscript IFS=' ' MYSQL="mysql -u user -ppassword database" $MYSQL -Ne "SELECT COUNT(1), MAX(id), MAX(name) FROM terminal"... (7 Replies)
Discussion started by: chebarbudo
7 Replies

4. Shell Programming and Scripting

set variable to command output

I'm hoping you guys can help me out here. I've been trying different methods to try and get what IW as hoping would be a fairly simple script but has turned into a pain. Bit of background - I am writing a script to check values in certain failes to ensure they are corerct. I'm runnign this on... (2 Replies)
Discussion started by: stuc
2 Replies

5. Shell Programming and Scripting

BASH - set specific user variable via string operators

Apologies for the utter triviality of this question, but we all have to start somewhere! I've also tried searching but this question is pretty vague so I didn't (a) really know what to search for or (b) get many relevant hits to what I did search for. Anyway, I'm in the process of self-teaching... (1 Reply)
Discussion started by: u5j84
1 Replies

6. HP-UX

What is the use of command set -- and set - variable?

Hi, I am using hp unix i want to know the use of the following commands set -- set - variable thanks (4 Replies)
Discussion started by: gomathi
4 Replies

7. Shell Programming and Scripting

set output of linux cmd as a variable in .exp

I am trying to make a script to take commands from a .txt file ( line by line) and pass it using send ( used in another function ) what i am trying to achieve is : set nol "`grep '' ${exp_path2}/cmdlist.txt | wc -l `" as in shell script nol=`grep '' $exp_path2/cmdlist.txt | wc -l` ... (0 Replies)
Discussion started by: dixyantar
0 Replies

8. Shell Programming and Scripting

Parse output path to set variable

I am looking to parse a text file output and set variables based on what is cropped from the parsing. Below is my script I am looking to add this feature too. All it does is scan a certain area of users directories for anyone using up more than X amount of disk space. It then writes to the... (4 Replies)
Discussion started by: es760
4 Replies

9. UNIX for Dummies Questions & Answers

Set Command to output a log of every command executed in the script

Hi Guys, I like to output every command executed in the script to a file. I have tried set -x which does the same. But it is not giving the logs of the child script which is being called from my script. Is there any parameters in the Set command or someother way where i can see the log... (2 Replies)
Discussion started by: mac4rfree
2 Replies

10. Shell Programming and Scripting

Save an specific part of a expect_out in a variable

I have a expect file like this #!/opt/tools/unsupported/expect-5.39/bin/expect spawn ssh -l user ip expect_after eof {exit 0} set timeout 10 log_file /report.txt expect "Password:" { send "pasword\r" } expect "$ " { send "date\r" } expect "$ " { send "readlink /somelink\r" } set... (7 Replies)
Discussion started by: bebehnaz
7 Replies
RHPICT(1)						      General Commands Manual							 RHPICT(1)

NAME
rhpict - render a RADIANCE picture from a holodeck file SYNOPSIS
rhpict [ options ] holodeck DESCRIPTION
Rhpict generates one or more pictures from the RADIANCE holodeck file holodeck and sends them to the standard output. The -o option may be used to specify an alternate output file. Other options specify the viewing parameters and provide some control over the calculation. The view as well as some of the other controls are shared in common with the rpict(1) command. The options that are unique to rhpict are given first, followed by the more familiar ones. -s Use the smooth resampling algorithm, which amounts to linear interpolation between ray samples with additional edge detection along color and object boundaries. This is the default. -r rf Use random resampling, where rf is a fraction from 0 to 1 indicating the desired degree of randomness. A random fraction of 0 is not the same as smooth resampling, because there is no linear interpolation, just Voronoi regions. Values greater than 1 produce interesting underwater effects. -x res Set the maximum x resolution to res. -y res Set the maximum y resolution to res. -pa rat Set the pixel aspect ratio (height over width) to rat. Either the x or the y resolution will be reduced so that the pixels have this ratio for the specified view. If rat is zero, then the x and y resolutions will adhere to the given maxima. -pe expval Set the exposure value for the output pictures to expval. Since filtering is performed by rhpict, there is little sense in pass- ing the output through pfilt(1), other than changing the exposure. This option eliminates that need. The value may be specified either as a multiplier, or as a number f-stops preceeded by a '+' or '-' character. -vtt Set view type to t. If t is 'v', a perspective view is selected. If t is 'l', a parallel view is used. A cylindrical panorma may be selected by setting t to the letter 'c'. This view is like a standard perspective vertically, but projected on a cylinder horizontally (like a soupcan's-eye view). Three fisheye views are provided as well; 'h' yields a hemispherical fisheye view, 'a' results in angular fisheye distortion, and 's' results in a planisphere (stereographic) projection. A hemispherical fisheye is a projection of the hemisphere onto a circle. The maximum view angle for this type is 180 degrees. An angular fisheye view is defined such that distance from the center of the image is proportional to the angle from the central view direction. An angular fisheye can display a full 360 degrees. A planisphere fisheye view maintains angular relationships between lines, and is com- monly used for sun path analysis. This is more commonly known as a "stereographic projection," but we avoid the term here so as not to confuse it with a stereoscopic pair. A planisphere fisheye can display up to (but not including) 360 degrees, although distortion becomes extreme as this limit is approached. Note that there is no space between the view type option and its single letter argument. -vp x y z Set the view point to x y z . This is the focal point of a perspective view or the center of a parallel projection. -vd xd yd zd Set the view direction vector to xd yd zd . -vu xd yd zd Set the view up vector (vertical direction) to xd yd zd . -vh val Set the view horizontal size to val. For a perspective projection (including fisheye views), val is the horizontal field of view (in degrees). For a parallel projection, val is the view width in world coordinates. -vv val Set the view vertical size to val. -vo val Set the view fore clipping plane at a distance of val from the view point. The plane will be perpendicular to the view direction for perspective and parallel view types. For fisheye view types, the clipping plane is actually a clipping sphere, centered on the view point with radius val. Objects in front of this imaginary surface will not be visible. This may be useful for seeing through walls (to get a longer perspective from an exterior view point) or for incremental rendering. A value of zero implies no foreground clipping. A negative value produces some interesting effects, since it creates an inverted image for objects behind the viewpoint. This possibility is provided mostly for the purpose of rendering stereographic holograms. -va val Set the view aft clipping plane at a distance of val from the view point. Like the view fore plane, it will be perpendicular to the view direction for perspective and parallel view types. For fisheye view types, the clipping plane is actually a clipping sphere, centered on the view point with radius val. Objects behind this imaginary surface will not be visible. A value of zero means no aft clipping, and is the only way to see infinitely distant objects such as the sky. -vs val Set the view shift to val. This is the amount the actual image will be shifted to the right of the specified view. This is option is useful for generating skewed perspectives or rendering an image a piece at a time. A value of 1 means that the ren- dered image starts just to the right of the normal view. A value of -1 would be to the left. Larger or fractional values are permitted as well. -vl val Set the view lift to val. This is the amount the actual image will be lifted up from the specified view, similar to the -vs option. -vf file Get view parameters from file, which may be a picture or a file created by rvu (with the "view" command). -S seqstart Instead of generating a single picture based only on the view parameters given on the command line, this option causes rhpict to read view options from the standard input and for each line containing a valid view specification, generate a corresponding pic- ture. Seqstart is a positive integer that will be associated with the first output frame, and incremented for successive output frames. By default, each frame is concatenated to the output stream, but it is possible to change this action using the -o option (described below). Multiple frames may be later extracted from a single output stream using the ra_rgbe(1) command. -o fspec Send the picture(s) to the file(s) given by fspec instead of the standard output. If this option is used in combination with -S and fspec contains an integer field for printf(3) (eg., "%03d") then the actual output file name will include the current frame number. -w Turn off warning messages. EXAMPLE
rhpict -vp 10 5 3 -vd 1 -.5 0 scene.hdk > scene.hdr rpict -S 1 -o frame%02d.hdr scene.hdk < keyframes.vf AUTHOR
Greg Ward SEE ALSO
getinfo(1), pfilt(1), pinterp(1), printf(3), ra_rgbe(1), rholo(1), rpict(1), rvu(1) RADIANCE
3/10/99 RHPICT(1)
All times are GMT -4. The time now is 09:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy