Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] Korn Shell execution Post 302829585 by kumarjt on Friday 5th of July 2013 08:33:43 AM
Old 07-05-2013
/home/dir2/script_2.ksh works good .
But the actual problem is something different , in place of script_2.ksh , what I have is a global_variable.cfg file which basically initializes values of a set of environment variables.

sample command in the global_variable.cfg file is like :
TEST_NAME="KUMARJIT"; export TEST_NAME

If I use /home/dir2/global_variable.cfg and try to access the value of TEST_NAME in my script , I am not able to see the value , whereas ,if I use . /home/dir2/global_variable.cfg ( please take a note of space between the dot and forward slash ) , I am able to access the value of the TEST_NAME variable .

Why ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

korn shellscript execution context - exit statement

Hi all, Could someone please explain to me the shell invocation process when running a script. How do I stop the shell from logging out when it reaches an exit statement in the script? if ; then echo 'Failed to copy ${FILE}.fmx to ${J2_HOME}/dev/rsc' ... (3 Replies)
Discussion started by: richgi
3 Replies

2. Shell Programming and Scripting

how to convert from korn shell to normal shell with this code?

well i have this code here..and it works fine in kornshell.. #!/bin/ksh home=c:/..../ input=$1 sed '1,3d' $input > $1.out line="" cat $1.out | while read a do line="$line $a" done echo $line > $1 rm $1.out however...now i want it just in normal sh mode..how to convert this?... (21 Replies)
Discussion started by: forevercalz
21 Replies

3. Shell Programming and Scripting

Korn Shell Script help required during execution...

Hi, The following Korne Shell script does not give any syntax errors but the following while running. Request you to please let me know, how can I define the variables viz.:- listDbs and getkey here, inorder to remove the error. 1) $ ksh -n setAlias $ 2) $ ksh -x setAlias +... (1 Reply)
Discussion started by: marconi
1 Replies

4. Shell Programming and Scripting

How to activate Korn Shell functionnalities in Bourne Shell

Hi All I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell. Some operations like calculation don't work : cat ${file1} | tail -$((${num1}-${num2})) > ${file2} Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies

5. UNIX for Dummies Questions & Answers

[Solved] execution problem

Hi I want to make a script . In this script i want to use input file and this input file consist of three numbers in a line for example input file is as below: 919876543210 09876543234567876 98764534245678 aircelmms","aircelweb","aircelwap" 096574235625... (2 Replies)
Discussion started by: esumiba
2 Replies

6. Shell Programming and Scripting

[SOLVED] Capturing output in a korn variable

Hi, I'm new to korn and having trouble capturing the text output from one program in an array that I can then feed into another program. Direct approaches didn't work, so I've tried to break it down thus: The program lonlat2pixline gives the values I need in the second column, so I print that... (4 Replies)
Discussion started by: daurin
4 Replies

7. UNIX for Dummies Questions & Answers

[solved]Korn, disabling * substitution

If I execute the following line of code: echo "*" I get a list of files in the current directory. What if all I wanted to do was display the asterisk itself? What does the code have to look like so all I get is an asterisk? Thanks ahead of time for your assistance ----------... (3 Replies)
Discussion started by: Wreckoning
3 Replies

8. Shell Programming and Scripting

[Solved] Command execution in Makefile

Linux Gurus, I have a query regarding the execution of a complex command in the makefile of the current system. I am currently using shell command in the makefile to execute the command. However my command fails as it is a combination of a many commands and execution collects a huge data...... (4 Replies)
Discussion started by: satishkumar432
4 Replies

9. Shell Programming and Scripting

[Solved] Issue with using for loop as for in {2..6} in korn shell

Hi i have to cut columns 2 to 6 from a file and assign it to arrays , The following code works for ctcol in 2 3 4 5 6; do set -A a$ctcol $(cut -d, -f $ctcol test_file) done how ever this does not work for ctcol in {2..6}; do set -A a$ctcol $(cut -d, -f $ctcol test_file)... (4 Replies)
Discussion started by: 100bees
4 Replies

10. Shell Programming and Scripting

[Solved] How to refer more than 9 command line inputs for a scripts in korn shell?

Hi all, I have a script which should take more than 9 command line inputs while running. Likescript.sh a s d f g h j j k l o p i u y t r e w Now in the script if I have to access one of the input which is at position after 9, in this case say 'p' then how can I do that? echo $12 will not work... (15 Replies)
Discussion started by: pat_pramod
15 Replies
HOBBITGRAPH.CFG(5)						File Formats Manual						HOBBITGRAPH.CFG(5)

NAME
hobbitgraph.cfg - Configuration of the hobbitgraph CGI SYNOPSIS
$BBHOME/etc/hobbitgraph.cfg DESCRIPTION
hobbitgraph.cgi(1) uses the configuration file $BBHOME/etc/hobbitgraph.cfg to build graphs from the RRD files collected by Xymon. FILE FORMAT
Each definition of a graph type begins with a "[SERVICE]" indicator, this is the name passed as the "service" parameter to hobbit- graph.cgi(1). If the service name passed to hobbitgraph.cgi is not found, it will attempt to match the service name to a graph via the TEST2RRD environment variable. So calling hobbitgraph.cgi with "service=cpu" or "service=la" will end up producing the same graph. A graph definition needs to have a TITLE and a YAXIS setting. These are texts shown as the title of the graph, and the YAXIS heading respectively. (The X-axis is always time-based). If a fixed set of RRD files are used for the graph, you just write those in the RRDtool definitions. Note that Xymon keeps all RRD files for a host in a separate directory per host, so you need not worry about the hostname being part of the RRD filename. For graphs that use multiple RRD files as input, you specify a filename pattern in the FNPATTERN statement, and optionally a pattern of files to exclude from the graph with EXFNPATTERN (see "[tcp]" for an example). When FNPATTERN is used, you can use "@RRDFN@" in the RRD- tool definitions to pick up each filename. "@RRDIDX@" is an index (starting at 0) for each file in the set. "@RRDPARAM@" contains the first word extracted from the pattern of files (see e.g. "[memory]" how this is used). "@COLOR@" picks a new color for each graph automatically. The remainder of the lines in each definition are passed directly to the RRDtool rrd_graph() routine. The following is an example of how the "la" (cpu) graph is defined. This is a simple definition that uses a single RRD-file, la.rrd: [la] TITLE CPU Load YAXIS Load DEF:avg=la.rrd:la:AVERAGE CDEF:la=avg,100,/ AREA:la#00CC00:CPU Load Average GPRINT:la:LAST: %5.1lf (cur) GPRINT:la:MAX: %5.1lf (max) GPRINT:la:MIN: %5.1lf (min) GPRINT:la:AVERAGE: %5.1lf (avg) Here is an example of a graph that uses multiple RRD-files, determined automatically at run-time via the FNPATTERN setting. Note how it uses the @RRDIDX@ to define a unique RRD parameter per input-file, and the @COLOR@ and @RRDPARAM@ items to pick unique colors and a match- ing text for the graph legend: [disk] FNPATTERN disk(.*).rrd TITLE Disk Utilization YAXIS % Full DEF:p@RRDIDX@=@RRDFN@:pct:AVERAGE LINE2:p@RRDIDX@#@COLOR@:@RRDPARAM@ -u 100 -l 0 GPRINT:p@RRDIDX@:LAST: %5.1lf (cur) GPRINT:p@RRDIDX@:MAX: %5.1lf (max) GPRINT:p@RRDIDX@:MIN: %5.1lf (min) GPRINT:p@RRDIDX@:AVERAGE: %5.1lf (avg) ADVANCED GRAPH TITLES
Normally the title of a graph is a static text defined in the hobbitgraph.cfg file. However, there may be situations where you want to use different titles for the same type of graph, e.g. if you are incorporating RRD files from MRTG into Xymon. In that case you can setup the TITLE definition so that it runs a custom script to determine the graph title. Like this: TITLE exec:/usr/local/bin/graphitle The /usr/local/bin/graphtitle command is then called with the hostname, the graphtype, the period string, and all of the RRD files used as parameters. The script must generate one line of output, which is then used as the title of the graph. ENVIRONMENT
TEST2RRD Maps service names to graph definitions. NOTES
Most of the RRD graph definitions shipped with Xymon have been ported from the definitions in the larrd-grapher.cgi CGI from LARRD 0.43c. SEE ALSO
hobbitserver.cfg(5), rrdtool(1), rrdgraph(1) Xymon Version 4.2.3: 4 Feb 2009 HOBBITGRAPH.CFG(5)
All times are GMT -4. The time now is 10:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy