I am trying to run a script which makes use of these environment variables, hence i need to export them out.
i've posted a similar post in an oracle forum. I've posted the same qn here to get some advise on the scripting aspect.
i execute my program in an unix environment by typeing "export_file.sh myscript.pl" at the prompt.
it runs successfully. However when i set cronjob
0 2 * * * export_file.sh myscript.pl, i get a load of error messages.
my export file----------
--------below is my perl script-----
----- The error message i got is ------
DBI connect('','username/pass@abc',...) failed: Error while trying to retrieve
text for error ORA-12154 (DBD ERROR: OCIServerAttach) at myscript.pl line 20
Can't call method "prepare" without a package or object reference at myscript.pl line 21.
#ERROR : Error while trying to retrieve text for error ORA-12154 (DBD ERROR:
OCIServerAttach).
hi,
1). i would like to know what is meant by environment variables?
2). is the number of envi variables is a constant number for unix systems?
3). how to see the list of envi variables (and the values of the envi variables)in a single command?
4). if this questions were already asked... (3 Replies)
Hi All
Some how, variables are not getting exported while running the script in cronjob. Variable value is coming blank. But the variables are geting the value when the same script I am running manually. Any idea why?
When running the script in cron-job
==================================... (7 Replies)
say i define an environment variable in a particular script (upgrade.sh).
my script is upgarde.sh and it calls another script try.sh. will this environment variable be accessible to try.sh also. if not how to I make environment variables global so that they can be used by any script. (2 Replies)
Hey everyone,
I have a problem with a certain shellscript. I have a script like this:
#!/bin/sh
template=$1
for values in {60,150,240,330}\ {60,150,240,330}\ {60,150,240,330}\ {60,150,240,330}; do
set $values
X=$1; Y=$2; Z=$3; M=$4
mkdir "X$X-Y$Y-Z$Z-M$M"
cp... (2 Replies)
Hello,
When I run this UNIX code without the -t option it gives me the desired results.
The code keeps the record with the greatest datetime based on the key columns.
I sort it first then sort it again with the -u option, that's it.
I need to have a variable to specify an ASCII character... (2 Replies)
can someone please explain to me what i'm doing wrong with this code:
WELT=$(awk '(($1 ~ "^${caag}$") || ($2 ~ "^${caag}$"))' /tmp/Compare.TEXT)
when run from the command line, it works. but it seems to be having a problem doing the comparison when variables are involved.
i tested from... (1 Reply)
1. The problem statement:
What is the mesg value set for your environment? If it is on, how would you turn off your current
session? How would you set it permanently?
3. The attempts at a solution :
Read Unix The textbook.
3rd chapter has many things like environment variables and... (5 Replies)
Discussion started by: mahinkhan22
5 Replies
LEARN ABOUT DEBIAN
service
service(8) System Manager's Manual service(8)NAME
service - run a System V init script
SYNOPSIS
service SCRIPT COMMAND [OPTIONS]
service --status-all
service --help | -h | --version
DESCRIPTION
service runs a System V init script in as predictable an environment as possible, removing most environment variables and with the current
working directory set to /.
The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT. The supported values of COMMAND depend on the
invoked script. service passes COMMAND and OPTIONS to the init script unmodified. All scripts should support at least the start and stop
commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start com-
mand.
service --status-all runs all init scripts, in alphabetical order, with the status command.
EXIT CODES
service calls the init script and returns the status returned by it.
FILES
/etc/init.d
The directory containing System V init scripts.
ENVIRONMENT
LANG, TERM
The only environment variables passed to the init scripts.
SEE ALSO
/etc/init.d/skeleton,
update-rc.d(8),
init(8),
invoke-rc.d(8).
Jan 2006 service(8)