Sponsored Content
Top Forums Shell Programming and Scripting Using variables in gnuplot within a shell script Post 302465134 by Dark2Bright on Thursday 21st of October 2010 05:25:40 PM
Old 10-21-2010
Using variables in gnuplot within a shell script

Hi everybody, please help me with this problem
Suppose I have a script like this to run commands of gnuplot.
Code:
#!/bin/sh
lib=$1
old="output/old/$lib.dat"
new="output/new/$lib.dat"

gnuplot << EOF
set logscale x
set logscale y
set size square
set grid
set pointsize 1
plot "< paste $old $new" using 1:4 ti '$lib'
EOF

Since I use logscale, some of my data which have value zero can not be displayed. So I want to write a simple function f(x) that, if the value is 0.000, I will change it to 0.001. Then I use the function on "using f($1):f($4)".
But I am afraid that the variable showing column $1 and $4 will be confused with the 1st and 4th variables of the shell script. Please tell me how I can deal with this problem.

Thank you very much.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Accessing variables of one shell script in another shell script

I have a variable $exe in a shell script file a.sh which I need to access in another shell script file b.sh. How can I do that? :rolleyes: Thanks!! (2 Replies)
Discussion started by: looza
2 Replies

2. Shell Programming and Scripting

Gnuplot shell script controlled animation

Hi, I am looking for basic shell script to feed Gnuplot with live data, to arrange basic animation. I mean one-liner one variable real function. Any idea or experiences from the past, generating Gnuplot animation on dumb terminal (ASCII only) ? Or please refer me to a nice web site. ... (7 Replies)
Discussion started by: darius2
7 Replies

3. Shell Programming and Scripting

Accessing variables of one shell script in another shell script

Hi All, I have a shell script called sample1.sh where I have 2 variables. Now I have another shell script called sample2.sh. I want the variables in sample1.sh to be available to sample2.sh. For example. In sample1.sh I am finding the sum of 2 numbers namely a and b. Now I want to access... (2 Replies)
Discussion started by: rsendhilmani
2 Replies

4. Shell Programming and Scripting

Variables in shell script

mysqldump --compact --add-drop-table -h192.168.150.80 -uroot -p somePass $combined | sed '/$combined/$table/g' | mysql $databaseThe sed part is not working from the above statement. The variables combined and table are already defined and instead of showing the actual variable, it is executing the... (4 Replies)
Discussion started by: shantanuo
4 Replies

5. HP-UX

Shell script variables

hi everyone, i'm writing shell script on hp-ux server that run by root user then (inside the script) su to database user and appl user..the reason for this script is to run some commands involve all users root and database and appl..anyway, variables when root in control is ok but when su, the... (1 Reply)
Discussion started by: neemoze
1 Replies

6. Shell Programming and Scripting

Passing gnuplot variables to shell script

Hi, I need to pass a gnuplot value to a shell script. I have a main shell script (Main.sh) that has a bunch of gnuplot commands. Main.sh calls another gnuplot script (Child.gnu). A part of the code in Child.gnu is as follows: sp '</data/src/scripts/results/plot_data.sh $col' u (A):2:3 w pm3d... (8 Replies)
Discussion started by: annazpereira
8 Replies

7. Shell Programming and Scripting

Pass shell variable to gnuplot

Hi I am plotting a series of CDFs using gnuplot using plot "data" u 1:(1./x.) smooth cumulative I am doing this over many files and I need to tune the x value to the number of lines that meets a particular condition. Is it possible to get the line count from shell using cat file | grep... (7 Replies)
Discussion started by: jamie_123
7 Replies

8. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

9. Shell Programming and Scripting

How to write config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

10. Shell Programming and Scripting

Shell script to create runtime variables based on the number of parameters passed in the script

Hi All, I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them abc.sh ---------- export Numbr_Parms=$# export a=1 while do export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
PLOTCHANGELOG(1)					      General Commands Manual						  PLOTCHANGELOG(1)

NAME
plotchangelog - graph debian changelogs SYNOPSIS
plotchangelog [options] changelog ... DESCRIPTION
plotchangelog is a tool to aid in visualizing a Debian changelog. The changelogs are graphed with gnuplot(1) , with the X axis of the graph denoting time of release and the Y axis denoting the debian version number of the package. Each individual release of the package is repre- sented by a point, and the points are color coded to indicate who released that version of the package. The upstream version number of the package can also be labeled on the graph. Alternatively, the Y axis can be configured to display the size of the changelog entry for each new version. Or it can be configured to display approximately how many bugs were fixed for each new version. Note that if the package is a debian-specific package, the entire package version will be used for the Y axis. This does not always work perfectly. READING THE GRAPH
The general outline of a package's graph is typically a series of peaks, starting at 1, going up to n, and then returning abruptly to 1. The higher the peaks, the more releases the maintainer made between new upstream versions of the package. If a package is debian-only, it's graph will just grow upwards without ever falling (although a bug in this program may cause it to fall sometimes, if the version number goes from say, 0.9 to say, 0.10 - this is interpreted wrong..) If the graph dips below 1, someone made a NMU of the package and upgraded it to a new upstream version, thus setting the debian version to 0. NMU's in general appear as fractional points like 1.1, 2.1, etc. A NMU can also be easily detected by looking at the points that repre- sent which maintainer uploaded the package -- a solitary point of a different type than the points before and after it is typically a NMU. It's also easy to tell by looking at the points when a package changes maintainers. OPTIONS
-l, --linecount Instead of using the debian version number as the Y axis, use the number of lines in the changelog entry for each version. Cannot be used together with --bugcount. -b, --bugcount Instead of using the debian version number as the Y axis, use the number of bugs that were closed by each changelog entry. Note that this number is obtained by searching for "#dddd" in the changelog, and so it may be inaccurate. Cannot be used together with --linecount. -c, --cumulative When used together with either --bugcount or --linecount, graphs the cumulative count rather than the count in each individual changelog entry. -v, --no-version Do not show upstream version labels. Useful if the graph gets too crowded. -m, --no-maint Do not differentiate between different maintainers of the package. -s file, --save=file Save the graph to file in postscript format instead of immediately displaying it. -u, --urgency Use larger points when displaying higher-urgency package uploads. --verbose Output the gnuplot script that is fed into gnuplot (for debugging purposes). -gcommands, --gnuplot=commands This allows you to insert gnuplot(1) commands into the gnuplot script that is used to generate the graph. The commands are placed after all initialization but before the final plot command. This can be used to override the default look provided by this program in arbitrary ways. You can also use things like "set terminal png color" to change the output file type, which is useful in conjunc- tion with the -s option. --help Show a usage summary. --version Display version, author and copyright information. --noconf, --no-conf Do not read any configuration files (see below). changelog ... The changelog files to graph. If multiple files are specified they will all be display on the same graph. The files may be com- pressed with gzip. Any text in them that is not in Debian changelog format will be ignored. CONFIGURATION VARIABLES
The two configuration files /etc/devscripts.conf and ~/.devscripts are sourced by a shell in that order to set configuration variables. The --no-conf option can be used to prevent reading these files. Environment variable settings are ignored when these configuration files are read. The currently recognised variables are: PLOTCHANGELOG_OPTIONS This is a space-separated list of options to always use, for example -l -b. Do not include -g or --gnuplot among this list as it may be ignored; see the next variable instead. PLOTCHANGELOG_GNUPLOT These are gnuplot commands which will be prepended to any such commands given on the command line. SEE ALSO
devscripts.conf(5). AUTHOR
Joey Hess <joey@kitenet.net> DEBIAN
Debian Utilities PLOTCHANGELOG(1)
All times are GMT -4. The time now is 10:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy