Sponsored Content
Top Forums Shell Programming and Scripting Unable to export Directory paths through Script Post 302466097 by sumeet on Monday 25th of October 2010 12:33:02 PM
Old 10-25-2010
Unable to export Directory paths through Script

Following is the output of .profile file -

$ cat /home/estdm2/.profile
Code:
#!/bin/ksh
set -o vi

alias l="ls -ltr"
umask 002

Following is the path setting script.

$ cat DM_ENV_VARS_NEW.ksh
Code:
#!/bin/ksh
. /home/estdm2/.profile

sEnv=$1
echo "We are in ${sEnv} environment"
echo "STEP010 - Set Environment Variables for script."
export DM_ETL_HOME=/etl/estdm2
export SCRIPT_DIR=${DM_ETL_HOME}/scripts
export BASE_LOG_DIR=${DM_ETL_HOME}/log
export LOG_DIR=${BASE_LOG_DIR}/script

When I call DM_ENV_VARS_NEW.ksh script from another script and print the variable, it prints nothing. So the export is not working properly

$ cat /etl/estdm2/dev/scripts/test.ksh
Code:
#!/bin/ksh
#
echo "Testing the script - DM_ENV_VARS.ksh"

/etl/estdm2/dev/scripts/DM_ENV_VARS_NEW.ksh DEV
echo ${DM_ETL_HOME}
echo $BASE_LOG_DIR

PHP Code:
$ /etl/estdm2/dev/scripts/test.ksh
Testing the script 
DM_ENV_VARS.ksh
We are in DEV environment
STEP010 
Set Environment Variables for script

I dont know what's going wrong with such a simple script.

I would appreciate any suggestion.

Thanks
Sumeet
 

10 More Discussions You Might Find Interesting

1. Solaris

need script for locked and unused user accounts in /export/home directory

Hi all, i have to need one script: 1. it will capture the unused user accounts in /export/home directory. 2. it will capture the locked user accounts in /export/home directory. Note: locked accounts will show in /etc/passwd like /bin/false --> (instead of ksh it will show false) the... (1 Reply)
Discussion started by: krishna176
1 Replies

2. UNIX for Dummies Questions & Answers

Unable to use mimesender to send attachments with spaces in the file names / paths

Hello, I found the mimesender multiple attachment emailing shell script in the FAQ of these forums, and I have been able to use it to send multiple files, but only if they don't have spaces in their file name or path. When I attempt to send a file with spaces in it's name, enclosed... (0 Replies)
Discussion started by: rsmorra
0 Replies

3. Solaris

find home directory paths for all users

How to find al the user's home directories? (2 Replies)
Discussion started by: a2156z
2 Replies

4. Shell Programming and Scripting

Find Directory from array of file names with paths

I have a script that generates a variable with the location of a file and its complete path. What i want to do is to "cd" to the directory where that file is located using the path name of the file. GIS has absolutely failed me. For example when i run my script it generates a variable called... (1 Reply)
Discussion started by: Knome
1 Replies

5. UNIX Desktop Questions & Answers

how to display paths of files in a directory

hi guys does anyone know how to display the file paths of the files stored within a directory at the command terminal? e.g. if i have a directory called "home", how do i display the file paths of the files inside the directory? cheers (2 Replies)
Discussion started by: Villaman69
2 Replies

6. UNIX for Dummies Questions & Answers

cat a list of directory paths only to a file

Hi! I would like to funnel a series of directories and subdirectories into a text file. This is the output I would like to see from a find command: /mypath/ABC_01/VISIT_01 /mypath/ABC_01/VISIT_02 /mypath/ABC_01/VISIT_03 /mypath/ABC_02/VISIT_01 /mypath/ABC_03/VISIT_01 I've tried: find... (2 Replies)
Discussion started by: goodbenito
2 Replies

7. UNIX for Advanced & Expert Users

Unable to export delimiter as variable to SQL

Hi, I'm using a shell wrapper to trigger a teradata sql fastexport script as follows: #!/bin/ksh export delm=`echo "\t"` fexp <<! SELECT COALESCE(TRIM(CAST(col1 AS VARCHAR(10))),'') ||'$delm'|| COALESCE(CAST(col2 AS VARCHAR(10)),'') ||'$delm'|| COALESCE(TRIM(col3),'') FROM TABLE; ... (11 Replies)
Discussion started by: sumoka
11 Replies

8. Shell Programming and Scripting

Awk to replace directory paths

Hi all, I have written a bash script to do a few things for my Splunk deployment, however, I am currently stuck on one part... I need to the current working directory (I collect this with `pwd`) in the script as it could in theory be run from a number of locations. I'm not that great with... (5 Replies)
Discussion started by: TauntaunHerder
5 Replies

9. Shell Programming and Scripting

Replace directory paths in multiple files at once

I need to update about 2400 files in a directory subtree, with a new directory path inside the files I need to change this occurence in all files: /d2/R12AB/VIS/apps/tech_st/10.1.2 with this: /u01/PROD/apps/apps_st/10.1.3 I know how to change single words using "find . -type f -print0 |... (6 Replies)
Discussion started by: wicus
6 Replies

10. Shell Programming and Scripting

Help with reading directory paths with spaces from a file

Hi I want to know how to handle the spaces in the below scenario. I have a file (CON_zip_path_1.txt) which has some directory paths with spaces in directory names . My requirement is to unzip these zip files to another path. Please see the code below and the error. CON_zip_path_1.txt... (4 Replies)
Discussion started by: paul1234
4 Replies
pfexec(1)                                                          User Commands                                                         pfexec(1)

NAME
pfexec, pfsh, pfcsh, pfksh - execute a command in a profile SYNOPSIS
/usr/bin/pfexec command /usr/bin/pfexec -P privspec command [ arg ...] /usr/bin/pfsh [ options ] [ argument ...] /usr/bin/pfcsh [ options ] [ argument ...] /usr/bin/pfksh [ options ] [ argument ...] DESCRIPTION
The pfexec program is used to execute commands with the attributes specified by the user's profiles in the exec_attr(4) database. It is invoked by the profile shells, pfsh, pfcsh, and pfksh which are linked to the Bourne shell, C shell, and Korn shell, respectively. Profiles are searched in the order specified in the user's entry in the user_attr(4) database. If the same command appears in more than one profile, the profile shell uses the first matching entry. The second form, pfexec -P privspec, allows a user to obtain the additional privileges awarded to the user's profiles in prof_attr(4). The privileges specification on the commands line is parsed using priv_str_to_set(3C). The resulting privileges are intersected with the union of the privileges specified using the "privs" keyword in prof_attr(4) for all the user's profiles and added to the inheritable set before executing the command. USAGE
pfexec is used to execute commands with predefined process attributes, such as specific user or group IDs. Refer to the sh(1), csh(1), and ksh(1) man pages for complete usage descriptions of the profile shells. EXAMPLES
Example 1: Obtaining additional user privileges example% pfexec -P all chown user file This command runs chown user file with all privileges assigned to the current user, not necessarily all privileges. EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), ksh(1), profiles(1), sh(1), exec_attr(4), prof_attr(4), user_attr(4), attributes(5) SunOS 5.10 3 Mar 2003 pfexec(1)
All times are GMT -4. The time now is 11:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy