Can someone explain the following shell command?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Can someone explain the following shell command?
# 1  
Old 01-08-2015
Can someone explain the following shell command?

Hi Forum.

I have the following script /home/user/EDW_ENV.sh to setup some environment variables as:

Code:
#####        section 1 PM_HOME             #####
export PC_DIR_BASE=/data/informatica/ming
export DIR_ORACLE=/data/sw/apps/oracle/Oracle_scripts
export DIR_INF_SERVER=/cygdrive/d/EDW/Informatica951
.....

What does the following shell command do?
Code:
. /home/user/EDW_ENV.sh

Is there another command to perform the same thing above?

I'm trying to add the same code in our ETL application (Informatica) Unix task but I'm getting the following error:

Code:
Severity	Timestamp	Node	Thread	Message Code	Message
INFO	1/8/2015 4:47:22 PM	node01_STCDEVINFM51	PRE-SESS	CMN_1954	[Pre/Post Session Command] Process id 9200. Standard output and error:
'.' is not recognized as an internal or external command,operable program or batch file.


Last edited by pchang; 01-08-2015 at 05:48 PM.. Reason: updated code
# 2  
Old 01-08-2015
Code:
. /home/user/EDW_ENV.sh

The . is an alias for Source command. This will execute the above file in the same process as the shell file that is calling above file. Since these two files run under the same process all the variables and functions inside EDW_ENV.sh are made available to the calling shell script. Try to replace . with source and try.

Last edited by vikas_trl; 01-08-2015 at 07:04 PM..
# 3  
Old 01-08-2015
"batch file" ?? Are you running this on Windows? If so, that would not work then...
# 4  
Old 01-09-2015
The source or . command works in shells like sh, ksh, bash. If you need to put sth into a "configuration" or "init" script for an application, read THAT man page on what commands it recognizes. .sh files might not be applicable there.
# 5  
Old 01-09-2015
Quote:
Originally Posted by Scrutinizer
"batch file" ?? Are you running this on Windows? If so, that would not work then...
I'm running the script on Cygwin running on windows.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Please help to explain the command

su - keibatch -c ""date ; /usr/local/kei/batch/apb/bin/JKEIKYK4140.sh -run "&$C$6&" WSUKE100201"" Not clear about : date ; /usr/local/kei/batch/apb/bin/JKEIKYK4140.sh -run "&$C$6&" WSUKE100201 Please help (2 Replies)
Discussion started by: honda_city
2 Replies

2. Shell Programming and Scripting

Can any one explain this sqlplus command?

Hi , i am new to unix i need a small clarification regarding this sqlplus -s $USER_NAME/$PASSWD@$ORA_SID<< EOF >> SQL_CONN_LOG.log In the above command what is the meaning of <<EOF>> Thanks, krishna. (2 Replies)
Discussion started by: rams_krishna
2 Replies

3. UNIX for Dummies Questions & Answers

Please explain this command?

Hi, I saw this. But I don't know why we need this? ls mydir > foo.txt ## I know what this will do, it will take the results and write to the file called foo.txt ls mydir > foo.txt 2>&1 ## Don't know why we need 2>&1 Thanks. (2 Replies)
Discussion started by: samnyc
2 Replies

4. Shell Programming and Scripting

Please Explain me this command

find . -type f -ctime +3 -exec mv {} /somedirectory/ \; in particular "-ctime v/s -mtime" and "difference between +3 and -3" (5 Replies)
Discussion started by: Rambo
5 Replies

5. UNIX for Dummies Questions & Answers

Can anyone explain what this command is doing?

Specifically what is the purpose of sed? What is f? Why is the 'cp f $phonefile' line needed when the script ‘goes live'? Why might that two commands following sed be commented out at the present time ( i.e., during development)? Thanks in... (2 Replies)
Discussion started by: knp808
2 Replies

6. Shell Programming and Scripting

please explain the command

Hi all , please explain the following command : perl -e 'select(undef,undef,undef,.15)' Thanks and Regards Navatha (2 Replies)
Discussion started by: Navatha
2 Replies

7. Shell Programming and Scripting

explain me this shell script ...

currentSid=${TWO_TASK:-$ORACLE_SID} echo $currentSid this script returns value of ORACLE_SID but what i am not getting is what is ":-" doing ?? (1 Reply)
Discussion started by: zedex
1 Replies

8. UNIX for Dummies Questions & Answers

Explain the output of the command....

Explain the output of the command “sort -rfn file1 | more” (1 Reply)
Discussion started by: wickbc
1 Replies

9. UNIX for Dummies Questions & Answers

explain command plz

echo -n "1. Updating Password Policy in OID..." | tee -a $logfile set ldap_v1 = `ldapsearch -b "" -h $oid_host -p $oid_port -D "cn=orcladmin" -w $admin_pwd -s sub "cn=PwdPolicyEntry" dn | head -1` echo "dn:$ldap_v1" > ldap1.out echo "changetype:modify" >> ldap1.out echo... (2 Replies)
Discussion started by: maoro
2 Replies

10. UNIX for Dummies Questions & Answers

Please explain this command line ?

Please explain this command line ? wc<infile<newfile Thanx, Saneesh Joseph. (2 Replies)
Discussion started by: saneeshjose
2 Replies
Login or Register to Ask a Question