Shell Variable

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Variable
# 1  
Old 10-10-2013
Shell Variable

Hi Everyone,

sqlplus -s $XXX/$ZZZ <<ENDSQL > /tmp/fictmp$$.tmp

Can anyone please tell me what exactly and for what purpose the "$$" in fictmp$$.tmp is used.

I know very well that its file name but how the $$ value is getting generated.

Thanks in Advance

Last edited by Scott; 10-10-2013 at 05:54 PM.. Reason: Code tags, please
# 2  
Old 10-10-2013
$$ is the process ID (PID).
# 3  
Old 10-10-2013
SmilieSmilieSmilie Ok, Thanks Subbeh
# 4  
Old 10-10-2013
This User Gave Thanks to Yoda For This Post:
# 5  
Old 10-11-2013
Might I suggest that you change your code to move the credentials to within the here document, similar to this:-
sqlplus -s <<ENDSQL > /tmp/fictmp$$.tmp
 select Hello from dual ;

They way you have it coded, anyone could issue:-
ps -ef|grep sqlplus

... and see your credentials.

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How can I assign awk's variable to shell script's variable?

I have the following script, and I want to assign the output ($10 and $5) from awk to N and L: grdinfo data.grd | awk '{print $10,$5}'| read N L output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies

2. Shell Programming and Scripting

how to assign more than 1 variable value from 1 common shell to many other shell files

i have 1 file say LogDirectory='/var/tmp/logs' DataDirectory='/var/tmp/data' DBUSER='scott' now i want to access these variables in many files where #!/bin/bash ${DBUSER} , ${DataDirectory} are called how do i do that? Video tutorial on how to use code tags in The UNIX and Linux... (2 Replies)
Discussion started by: Gl@)!aTor
2 Replies

3. Shell Programming and Scripting

[SHELL: /bin/sh] For loop using variable variable names

Simple enough problem I think, I just can't seem to get it right. The below doesn't work as intended, it's just a function defined in a much larger script: CheckValues() { for field in \ Group_ID \ Group_Title \ Rule_ID \ Rule_Severity \ ... (2 Replies)
Discussion started by: Vryali
2 Replies

4. Shell Programming and Scripting

C Shell path variable causing very slow shell!?HELP

I am using C Shell MKS Toolkit and I ran into a huge problem when setting up some environment variables.:confused: The csh script that I have as my login script runs fine but very very slow. When I add a directory to my PATH it seems to slow down shell startup and even slow down the commands. ... (0 Replies)
Discussion started by: vas28r13
0 Replies

5. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

6. Shell Programming and Scripting

Shell assign variable to another variable

How can I assign a variable to an variable. IE $car=honda One way I can do it is export $car=honda or let $car=2323 Is there any other ways to preform this task (3 Replies)
Discussion started by: 3junior
3 Replies

7. Shell Programming and Scripting

assign awk's variable to shell script's variable?

Dear All, we have a command output which looks like : Total 200 queues in 30000 Kbytes and we're going to get "200" and "30000" for further process. currently, i'm using : numA=echo $OUTPUT | awk '{print $2}' numB=echo $OUTPUT | awk '{print $5}' my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies

8. Shell Programming and Scripting

Local variable shell/new shell

Hi! I'm trying to figure out how to reuse an "old" variable in a new bourne shell. Am i supposed to use the export function? If i write: NAME="Simon" echo $NAME it returns Simon, but if i start a new shell and write echo $NAME it can't be found of course. How do i solve this? ... (7 Replies)
Discussion started by: bib2006
7 Replies

9. Shell Programming and Scripting

Enviornment Variable in B shell (I call it nested variable)

#!/bin/sh APP_ROOT_MODE1=/opt/app1.0 APP_ROOT_MODE2=/opt/app2.0 APP_ROOT=${APP_ROOT_${APP_MODE}} # enviornment variable APP_MODE will be exported in the terminal where # we run the applciation, its value is string - MODE1 or MODE2 # My intension is: # when export APP_MODE=MODE1... (4 Replies)
Discussion started by: princelinux
4 Replies

10. Shell Programming and Scripting

set variable with another variable? c shell

okay, this shouldn't be difficult but I can't figure it out. How can I set a variable with another variable. I have the following: foreach pe ($dir $sp) set tpe = `echo $pe | grep M` if ($tpe == M) then set ${$pe} = M <--- This doesn't work else endif end In this case what... (2 Replies)
Discussion started by: wxornot
2 Replies
Login or Register to Ask a Question