Sponsored Content
Operating Systems OS X (Apple) Plotting A Sine Curve Inside A Bash Shell... Post 302914574 by wisecracker on Tuesday 26th of August 2014 05:47:42 PM
Old 08-26-2014
Hi Corona688...

Hmm, neat.

I never considered using 'awk' in its entirety.

Although I have used 'amplitude' and 'centreline' values to plot inside the terminal I intend to use character 32 (space) and 126 (tilde) as the pk-pk amplitude(s) and "N" or "O" as the centreline. This then makes the whole waveform fully editable in any text mode editor. ;o)

I never even considered how Windows would react under my version as I was more interested in a calculator as a 'bc' replacement for CygWin.

I seem to remember you pointing out how badly Windows reacts to many fork()s in a thread since gone.

Thanks for your creation. Once I have gotten to grips with it consider it stolen... ;oD
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[BASH] redirect standard error and use it inside

Hi all, Maybe my question is too simple but till now i couldn't figure about a solution :( I have a bash script scheduled in cron: <cron time parameters> my_script.sh > result.log 2>&1 By this way i can have standard output and standard error in my result.log file Now i want my script... (2 Replies)
Discussion started by: Pescator
2 Replies

2. Shell Programming and Scripting

running bash command inside awk

Org file 192.168.1.10 d:\adir\xdir 192.168.1.11 d:\bdir\ydir want to covert it into robocopy \\192.168.1.10\d$\adir\xdir\log* some_localdir\adir robocopy \\192.168.1.10\d$\adir\ydir\log* some_localdir\bbdir (5 Replies)
Discussion started by: ydk
5 Replies

3. UNIX for Dummies Questions & Answers

using awk inside bash script?

Hello, I'm trying to write a bash script that will query the current system time (OS X 10.6.6) and then convert the output from HH:MM:SS into time in seconds. The output of the system time command (systemsetup -gettime) is returned as: Time: HH:MM:SS so I wanted to use awk -F: to grab... (5 Replies)
Discussion started by: xaiu
5 Replies

4. Shell Programming and Scripting

Learning curve to understand bash iteration

Hi Folks, I know on one side there is script and on another side there is smart script. I am able to achieve what I got but thought there has to be a code which doesn't require multiple lines. So if you guys can help me out than it will be awesome. Also I wrote in cshell but if can get both the... (4 Replies)
Discussion started by: dixits
4 Replies

5. Shell Programming and Scripting

Hide bash code which is inside C plus plus program

I am embedding bash in cpp. Can the bash code be hidden (when we cat the executable to not be able to see the bash code) The simple code I am using: #include <iostream> #include <cstdlib> using namespace std; #define test1 "\ #!/bin/sh --posix \n\ echo... (1 Reply)
Discussion started by: frad
1 Replies

6. Shell Programming and Scripting

Aliases NOT working inside bash shell script

i have defined a function ln_s() for customizing the ln command in script1.sh. more script1.sh echo "Starting Execution" ./script2.sh echo "End of Execution" ln_s(){ ] && return ln -s "$1" "$2" } My script1.sh executes another script2.sh which has the following entry more script2.sh... (12 Replies)
Discussion started by: mohtashims
12 Replies

7. Shell Programming and Scripting

Need Multiple checks inside if condition in a bash shell script

Hi, I need to perform the untar and rm operation if the file found is a .tar and does not have test.tar or hello.tar as the file names. Below is the loop to check the same. for tf in *.tar do if ] then found=1 ... (1 Reply)
Discussion started by: mohtashims
1 Replies
vsynth(1Vi)															       vsynth(1Vi)

NAME
vsynth - synthesize an image SYNOPSIS
vsynth -pattern pattern [-option ...] [outfile] DESCRIPTION
vsynth creates a one-band image with a specified size, pixel representation, and pattern of pixel values. The program knows how to create several different types of patterns. These are described below under PATTERNS. COMMAND LINE OPTIONS
vsynth accepts the following options in addition to those described below under PATTERNS. -help Prints a message describing options. -out outfile Specifies where the synthesized image is to be written as a Vista data file. -pattern pattern Specifies, with one of the keywords listed below, the type of pattern to be used to set pixel values. -nrows nrows and -ncolumns ncolumns Specify the size of the synthesized image. Default: 256 rows and columns. -repn bit | ubyte | sbyte | short | long | float | double Specifies the pixel representation of the synthesized image. Default: float. -name name Specifies the name to be given the synthesized image. Default: ``image''. The output file can be specified on the command line or allowed to default to the standard output stream. PATTERNS
The -pattern option specifies which of the following patterns is used to initialized pixel values. For each type of pattern there are addi- tional options that may be used to specify pattern parameters. In general, numeric parameters are not restricted to just integer values. Constant -pattern constant [-base b] Default: 0. All pixel values are set to b. Impulse -pattern impulse [-amplitude a] Default: 1. [-base b] Default: 0. [-origin i j] Default: image center. The pixel at row i, column j is set to a; all others are set to b. (i and j are truncated to integers.) Ramp -pattern ramp [-amplitude a] Default: 1. [-base b] Default: 0. [-origin i j] Default: image center. [-orientation d] Default: 0. The image is filled with a ramp whose slope is a units per pixel. The ramp is centered at row i, column j, where it has the value b. The ramp increases in the direction d, which is measured CCW in degrees from the direction of increasing column number. Sine Grating -pattern sine [-amplitude a] Default: 1. [-base b] Default: 0. [-origin i j] Default: image center. [-phase w] Default: 0. and one of [-frequency f] Default: 0. [-orientation d] Default: 0. or [-period t] Default: 8. [-orientation d] Default: 0. or [-xfreq x] Default: 0. [-yfreq y] Default: 0. The image is filled with a sine grating. The grating has a DC component of b and an amplitude of a (or 2a peak-to-peak). Its fre- quency and direction may be specified by any of three combinations of frequency (in cycles per pixel, measured either in the direc- tion of the grating or as horizontal and vertical components), period (in pixels per cycle), and orientation (in degrees CCW from the direction of increasing column number). The grating is shifted so that at row i, column j it has phase w radians. Zone Plate -pattern zone [-amplitude a] Default: 1. [-base b] Default: 0. [-origin i j] Default: image center. [-period t] Default: 8. [-phase w] Default: 0. The image is filled with the zone plate pattern defined by f(r) = a cos(r^2/t + w) + b, where r is the radial distance from the ori- gin at row i, column j. Uniformly Distributed Noise -pattern uniform [-amplitude a] Default: 1. [-base b] Default: 1. [-seed s] Default: a random number. Pixels are set to random values drawn independently from [b,b+a] according to a uniform distribution. The random number generator is initialized with the seed s. Normally Distributed Noise -pattern normal [-amplitude a] Default: 1. [-base b] Default: 1. [-seed s] Default: a random number. Pixel values are set to random values drawn independently according to a normal (Gaussian) distribution with mean b and standard deviation a. The random number generator is initialized with the seed s. Binomially Distributed Noise -pattern binomial [-amplitude a] Default: 1. [-base b] Default: 1. [-density p] Default: 0.5. [-seed s] Default: a random number. Pixel values are drawn at random from a binomial distribution. A pixel is given the value b with probability 1 -p, and it is given the value b+a with probability p. SEE ALSO
VImage(3Vi), Vista(7Vi) AUTHOR
Art Pope <pope@cs.ubc.ca> Vista Version 1.12 31 March 1994 vsynth(1Vi)
All times are GMT -4. The time now is 04:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy