Sponsored Content
Top Forums Shell Programming and Scripting Setting up env variable in ksh Post 302778413 by Tuxidow on Monday 11th of March 2013 01:27:21 AM
Old 03-11-2013
UploadEnv file

Code:
#!/usr/bin/ksh
########################################################
# Configuration variables for the Upload process
########################################################
export TODAY=`date +%Y%m%d`  ## YYYYMMDD
export TIME=`date +%H%M%S`   ## HHMMSS
export month=`date +"%Y%m"`
export lmonth=`date +"%Y%m" -d last-month`

export MAIL_TO="email@example.com"
export SCRIPT_HOME=/home/user/deepmarking
export LOG_DIR=${SCRIPT_HOME}/log
export DATA_DIR=${SCRIPT_HOME}/data
export SCRIPT_DIR=${SCRIPT_HOME}/script
export BACKUP_DIR=${SCRIPT_HOME}/data/backup
export DB_ITNAPP_R_USER=itnapp
export DB_ITNRO_E_PASSWD="aswQrtQU3YnQrdXA="
export DB_ITNRO_D_KEY="K3UFQN215bTZBN1MwZVA="
export DB_ITNAPP_R_SID=nothing
export LOGFILE=${LOG_DIR}/Job.log
export FTPSERVER=ftpserver.example.com
export FTP_DATA_DIR=/tmp/deepmarking/data
export FTPUSER=ftpuser
export FTP_E_PASSWD="VFpybHRzTmFDSzF4aGVjVDMUY1NHJoOTc="
export FTP_D_KEY="ZnBpNTZIlF1SkZkVlJZRElVQWI0WDg="
export PGPPATH=/opt/pgp/bin
export JAVAPATH=/opt/java/jdk1.6.0_24/bin
export JAR_FILE=${SCRIPT_DIR}/endcrypt-dbcp-jar-with-dependencies.jar
export OLDFILEDAYS=10

export FILE=${lmonth}01

export FTP_LOG_FILE=${LOG_DIR}/ftp_files_$TODAY\_$TIME.log

 

10 More Discussions You Might Find Interesting

1. Solaris

setting env

I am trying to set up my compiler, but when I go to look for gcc it not found but I get a message that stayed (/usr/oasys/bin) and when I go into the dir to set my env the following is type cp : cannot creat //pref/.environ: no such file or directory and I input ./setenv PATH=... (3 Replies)
Discussion started by: alsande
3 Replies

2. Shell Programming and Scripting

Some env setting is causing the script not to work ?

Not sure what has changed in the Unix environment. The following script which was working is now not working. #!/usr/bin/ksh # ----------------------------------------------------------------------------- # File: monitor_db.sh # #... (1 Reply)
Discussion started by: uuser
1 Replies

3. AIX

edit env. setting

hi eveybody, i m trying to set acl using acledit command in AIX box but wat im gettung is 3002-100 acledit: EDITOR environment variable not set can anyone help me out how 2 set editor.................... thanks in advance (4 Replies)
Discussion started by: rrlog
4 Replies

4. Red Hat

Help with csh env setting in Fedora 8

Hi there, How can I change bash to csh when starting a terminal, and set some aliases for csh? I can't find such files like .cshrc in my home directory. Thanks a lot (1 Reply)
Discussion started by: dustinwang2003
1 Replies

5. Shell Programming and Scripting

setting ksh environmental variable

Hi, I have problem setting up environmental variables. The idea is to start with main.ksh script that will run setting.ksh, and in side of it I'll set up variables. Please take a look at my code, and help me to find my mistake. Thanks, Mila Main.ksh look like this: #!/usr/bin/ksh #... (2 Replies)
Discussion started by: mefquik
2 Replies

6. UNIX for Dummies Questions & Answers

Setting env variables using script

Hi, I wrote two small scripts to set env variables in a shell. java_env.csh #!/bin/csh -fn setenv JAVA_HOME '/scratch/software/jdk1.5.0_11' setenv PATH $PATH':'$JAVA_HOME'/bin' and run it using csh ./java_env.csh But the env variables are not set. I tried running each line on the... (5 Replies)
Discussion started by: NoviceAmod
5 Replies

7. Shell Programming and Scripting

Setting Variable in TCL to be understood by KSH Shell

Hi , I am having one TCL TK script , I am setting some variables in the GUI TK interface set DI 1 set MODELS_PATH /a/d/path but I want to make ksh shell understand the variables when I am running TK script I tried to do like this set a but it is not working ... (1 Reply)
Discussion started by: kshitij
1 Replies

8. Shell Programming and Scripting

Setting a variable in a while loop (.ksh script)

Hello Everyone, I'm still trying to grasp many concepts in .ksh scripting, one of them being variables inside loops. My problem is the following: * I'm trying to set a variable inside a while read loop to reuse it outside of said loop. My lines are the following :... (13 Replies)
Discussion started by: jimmy75_13
13 Replies

9. Web Development

Deny from env=env-variable Does not work

(Above from Apache docs). On my system, using: SetEnvIf User-Agent Mozilla IsBad=1 Order allow,deny Allow from all Deny from env=IsBad ...I see that environment variable is set (using phpinfo()) but the page is still served. No errors in the Apache logs. (1 Reply)
Discussion started by: gnurob
1 Replies

10. Shell Programming and Scripting

Setting ENV variables in PERL

I have perl script and in the first line we are invoking .sh script to set ENV variables. e..g eval '. $envfile; exec $PERL -S $0 "$@"' I want to change some of the env variables while the program is running and I am settging it like this .. $ENV{ORACLE_HOME}=trim($oraclehome);... (1 Reply)
Discussion started by: talashil
1 Replies
times(1)							   User Commands							  times(1)

NAME
times - shell built-in function to report time usages of the current shell SYNOPSIS
sh times ksh times DESCRIPTION
sh Print the accumulated user and system times for processes run from the shell. ksh Print the accumulated user and system times for the shell and for processes run from the shell. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
ksh(1), sh(1), time(1), attributes(5) SunOS 5.10 15 Apr 1994 times(1)
All times are GMT -4. The time now is 09:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy