08-05-2014
Ahh great, thanks alot...
Had tried different approaches without luck, was pretty sure i could be done... thanks
![Smilie Smilie](https://www.unix.com/images/smilies/smile.gif)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I do a lot of command line scripting to capture data from files or other command output. I've checked in a number of Unix and scripting books but for the life of me I can't find out how to asign field data from nawk output into variables that I can manipulate later. For example, reading a two... (6 Replies)
Discussion started by: steveje0711
6 Replies
2. Shell Programming and Scripting
Hello friends,
I doing the follwing script , but found problem to store it to a shell variable.
#! /bin/sh
for temp in `find ./dat/vector/ -name '*.file'`
do
echo $temp
nawk -v temp=$temp 'BEGIN{ split(temp, a,"\/"); print a}'
done
output:
./dat/vector/drf_all_002.file... (6 Replies)
Discussion started by: user_prady
6 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I'm trying to assign a numeric value that is returned from one of my programs to a variable in tcsh. I want to do:
@ r10 = './my_prog file 35'
where ./my_prog file 35 returns a decimal value, but this doesn't work. How do I achieve the desired result?
Janet (4 Replies)
Discussion started by: psran
4 Replies
4. Shell Programming and Scripting
This is probably a simple one for the wise.
I have just started using a coprocess (first time) in order to facilitate telnet'ing from inside a shell script. It's working, but when I run a remote command I need to get the output into a local variable, but alas my kung-fu is weak.
#!... (10 Replies)
Discussion started by: dan-e
10 Replies
5. Shell Programming and Scripting
Hi all
i have 2 input files
1st file is
N1 | N2|N3|N4|N5|N6|N7|N8|N9
4041491000|245160|1|0|0|1|0|0|0
4041401505|152178|1|1|1|1|0|0|0
4041450004|014052|1|1|1|1|0|0|0
4041450005|580916|1|1|1|1|0|0|0
4041491000|230990|1|0|1|1|0|0|0
4041460001|338317|1|1|1|1|0|0|0
2nd file
N1 |... (8 Replies)
Discussion started by: dodasajan
8 Replies
6. Shell Programming and Scripting
Hello,
There is pipe chain and I want concacenate piped data with some variable:
balh blah| ... $var1
What command I should use instead ... to concatenate piped output with $var1. I think I coud solve this using temp var - but could it be done in one line like sample above ?
thanks... (4 Replies)
Discussion started by: vilius
4 Replies
7. Shell Programming and Scripting
I'm writing a Texas Hold'em script in bash v3.00.16(1) to learn more about awk/nawk scripts and regex expressions by trying to randomize a list of names using awk's rand function. The problem is that the elements in the var convert to a single element in the nawk script. I've tried several things,... (4 Replies)
Discussion started by: HexKnot
4 Replies
8. Shell Programming and Scripting
Legends,
I have 2 files f1 and f2. when i use nawk to compare the difference(subtraction) from 4th column of the file, it truncates the output.
can you please help to resolve this.
subtraction is (4th col of f1 - 4th col of f2). but it gives only below lines out of 116. I want to print all... (7 Replies)
Discussion started by: sdosanjh
7 Replies
9. UNIX for Advanced & Expert Users
Hi all,
I have F5 load balancer on my system and checking service status by opening an ftp session in every 30 seconds. These ftp sessions are being logged in /var/adm/wtmpx and filling up the file. when i run the last command most of the output is this ftp session. I was wondering if there is a... (1 Reply)
Discussion started by: cepxat
1 Replies
10. Shell Programming and Scripting
Hi All,
I am working on nawk script, has the small function which prints the output on the screen.Am trying to print/append the same output in a file.
Basically nawk script should print the output on the console/screen and as well it should write/append the same result to a file.
script :... (3 Replies)
Discussion started by: Optimus81
3 Replies
xgas(1X) xgas(1X)
NAME
xgas - animated simulation of an ideal gas
SYNOPSIS
xgas [-option...]
OPTIONS
This is a toolkit program; all the usual toolkit options are available. Sets the autoStart resource. Sets the timeStepSize resource.
Sets the delay resource. Sets the randomBounce resource. Sets the equilibrium resource. Sets the maxMolecules resource. Sets the fore-
ground. Sets the background.
DESCRIPTION
xgas is a physical simulation of an ideal gas in a heated box. Gas molecules move around the box with velocities dependent on their temper-
ature. A chamber consisting of two boxes contains the gas molecules; the temperature of each box can be independently controlled by a
scrollbar. When gas molecules collide with the walls, their temperature approaches that of the box.
Use mouse button 1 to create molecules one at a time at the cursor position. Use mouse button 2 to create the maximum number of molecules
at the cursor position.
RESOURCES
The xgas program uses the following X resources: Starts the simulation automatically. Good for canned demos. Specifies the simulated time
duration in microseconds for each cycle of computation. Specifies the real time interval between timestep computations. In each wall col-
lision, a molecule bounces elastically (angle of incidence = angle of reflection). A component of randomness is added to this angle. Ran-
domBounce varies from 0.0 (no randomness) to 1.0 (completely random angle of incidence). During each wall collision, a molecule's kinetic
energy approaches that corresponding to the temperature of the wall. If equilibrium is 1.0, the molecule reaches the wall temperature imme-
diately. For values between 1.0 and 0.0, the molecule approaches the temperature of the wall more slowly. Specifies the maximum number of
molecules in the simulation.
BUGS
When the chamber is resized, molecules should be rearranged appropriately. Instead, the molecule arrays are reinitialized.
SEE ALSO
X(1X), xwd(1X)
AUTHOR
Larry Medwin
xgas(1X)