06-30-2008
how do i get a result in fraction in shell script.
I am using expr for division of two numbers but it is giving Quotient.
I need it in full fraction value.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is it possible to pass a variable name, as a parameter to a function, so it can be created within this function ?
Something like this:
func_uppercase abcdefgh var_name
where the 1st parameter is the string I want to convert and the 2nd is the desired variable name...
$2=`echo "$1" |... (2 Replies)
Discussion started by: 435 Gavea
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I am trying to sum up numbered columns and in order to tidy up the program I have wrote a function to do the adding of some numbers. I have a problem though with passing a variable to the function in the UNIX bash shell. The function only gives the first number in the variable list and does... (4 Replies)
Discussion started by: Knotty
4 Replies
3. UNIX for Advanced & Expert Users
Suppose I have a unix variable called RGNM which is holding a value. Now I want to call a plsql function in my script. THis plsql function takes one IN parameter. I want to pass my UNIX VARIABLE Value to the plsql function. Can i just give it by giving $RGNM in the function after calling sqlplus... (1 Reply)
Discussion started by: cobroraj
1 Replies
4. UNIX for Dummies Questions & Answers
I would like to know how to pass a variable inside a variable to a function.
sample code below
--------------
for x in 1 9
do
check_null $C$x ##call function to check if the value is null
if
then
echo "line number:$var_cnt,... (2 Replies)
Discussion started by: KingVikram
2 Replies
5. Shell Programming and Scripting
I have two scripts. script1.sh looks
--------------------------------
#!/bin/bash
display()
{
echo "Welcome to Unix"
}
display
-----------------------------
Script2.sh
#!/bin/bash
sh script1.sh //simply calling script1.sh
------------------------------ (1 Reply)
Discussion started by: mvictorvijayan
1 Replies
6. Shell Programming and Scripting
following on from below link
https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569
i will be using file reading in while loop say for example
while read line123
do
echo "line read is $line123"
insert_funct $line123
done< mysqldump.sql... (6 Replies)
Discussion started by: vivek d r
6 Replies
7. Shell Programming and Scripting
emailid=myemail@xyz.com
taskName="DB-Backup"
starttime=`date`
email()
{
subject="$taskName" ": " $* " at `date` "
mutt -s "$subject" $emailid < /dev/null
}
email "Starting"
#do my stuff
email "Finished"
The above code gives following error
./dbbackup.sh: line 6: :... (5 Replies)
Discussion started by: nitiraj.rathore
5 Replies
8. Shell Programming and Scripting
Hello All,
I would like to ask help from you on how to pass variable value from a function that has been called inside the function. I have created below and
put the variables in " ". Is there another way I can do this? Thank you in advance.
readtasklist() {
while read -r mod ver... (1 Reply)
Discussion started by: aderamos12
1 Replies
9. Shell Programming and Scripting
I have the below script which creates a directory or simply terminates without throwing error (exit 1) incase the directory exists.
bash-4.1$ vi mdir.sh
#!/bin/bash -e
shopt -s expand_aliases
alias mkdir=mkdir_s
mkdir_s(){
if ]; then
echo " directory EXISTS "
return
else
echo "... (3 Replies)
Discussion started by: mohtashims
3 Replies
10. Shell Programming and Scripting
I want to make a config file which contain all the paths.
i want to read the config file line by line and pass as an argument on my below function.
Replace all the path with reading config path line by line and pass in respective functions.
how can i achieve that?
Kindly guide.
... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
LEARN ABOUT OPENSOLARIS
graph
graph(1) User Commands graph(1)
NAME
graph - draw a graph
SYNOPSIS
graph [-a spacing [start]] [-b] [-c string] [-g gridstyle]
[-l label] [-m connectmode] [-s]
[-x [l] lower [ upper [spacing]]]
[-y [l] lower [upper [spacing]]] [-h fraction]
[-w fraction] [-r fraction] [-u fraction] [-t] ...
DESCRIPTION
graph with no options takes pairs of numbers from the standard input as abscissaes and ordinates of a graph. Successive points are con-
nected by straight lines. The standard output from graph contains plotting instructions suitable for input to plot(1B) or to the command
lpr -g (see lpr(1B)).
If the coordinates of a point are followed by a nonnumeric string, that string is printed as a label beginning on the point. Labels may be
surrounded with quotes "...", in which case they may be empty or contain blanks and numbers; labels never contain NEWLINE characters.
A legend indicating grid range is produced with a grid unless the -s option is present.
OPTIONS
Each option is recognized as a separate argument. If a specified lower limit exceeds the upper limit, the axis is reversed.
-a spacing[ start ]
Supply abscissaes automatically (they are missing from the input); spacing is the spacing (default 1). start is the starting point for
automatic abscissaes (default 0 or lower limit given by -x).
-b
Break (disconnect) the graph after each label in the input.
-c string
String is the default label for each point.
-g gridstyle
Gridstyle is the grid style: 0 no grid, 1 frame with ticks, 2 full grid (default).
-l label
label is label for graph.
-m connectmode
Mode (style) of connecting lines: 0 disconnected, 1 connected (default). Some devices give distinguishable line styles for other small
integers.
-s
Save screen, do not erase before plotting.
-x [ l ] lower [ upper [ spacing ] ]
If l is present, x axis is logarithmic. lower and upper are lower (and upper) x limits. spacing, if present, is grid spacing on x
axis. Normally these quantities are determined automatically.
-y [ l ] lower [ upper [ spacing ] ]
If l is present, y axis is logarithmic. lower and upper are lower (and upper) y limits. spacing, if present, is grid spacing on y
axis. Normally these quantities are determined automatically.
-h fraction
fraction of space for height.
-w fraction
fraction of space for width.
-r fraction
fraction of space to move right before plotting.
-u fraction
fraction of space to move up before plotting.
-t
Transpose horizontal and vertical axes. Option -x now applies to the vertical axis.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
SEE ALSO
lpr(1B), plot(1B), spline(1), plot(3PLOT), attributes(5)
BUGS
graph stores all points internally and drops those for which there is no room.
Segments that run out of bounds are dropped, not windowed.
Logarithmic axes may not be reversed.
SunOS 5.11 14 Sep 1992 graph(1)