explain the commands below


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers explain the commands below
# 1  
Old 12-08-2008
explain the commands below

logfile=$(find $jobroot/logs -mtime -1 | grep runoraback ) echo 'here is the logfile:'
echo "$logfile"
echo "$logfile" > $wkdir/log.$$
# 2  
Old 12-08-2008
what i need to understand is the line below

echo "$logfile" > $wkdir/log.$$


wat does $$ mean here..
# 3  
Old 12-08-2008
$$ is the process ID of the current script.
It is a way of generating temporary file names which won't clash with other similar processes running at the same time. It is not suitable for files you want to keep for any length of time because process IDs get re-used. It is customary to delete such workfiles after use from within the script.
# 4  
Old 12-10-2008
$$ represents the current shell Id not the current script Id.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How I can explain this?

Hi friends! I'm learning UNIX and I have a small question. Working with Shell, i put the name of one executable (in c language) + one number and it says this: $ gcc misterioso_4.c $ ./misterioso_4 6 got: , I can not find an answer in the manual because I havent applied any variable.... (5 Replies)
Discussion started by: dakota
5 Replies

2. UNIX for Dummies Questions & Answers

Explain perl formatting commands

Could you please tell the meaning of Below mentioned perl script lines: format OWNER_TOTAL = @< Owner Code @<<<<<<total: @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @#######.## @###### #.## $prev_cust_type, $prev_owner_code,... (2 Replies)
Discussion started by: vinothrajan55
2 Replies

3. Shell Programming and Scripting

anyone can explain this?

why the case 2 will happen ? , ' should stop the history substitution ,shouldn't it? case 1 # echo "123"|sed '/123/!d' 123 case 2 # echo "123 > 456 > 1 > "|sed '/123/!d' -bash: !d': event not found case 3 # echo "123 > 456 > 12 > "|sed '/123/'\!d 123 # bash --version (1 Reply)
Discussion started by: justlooks
1 Replies

4. Shell Programming and Scripting

need explain

Dear unix team i'm user for a system build on unix system ,so we need to run a lot of scripts not in one sission but every script on the associated terminal , so the script name = the name of the terminal which will run this script on it . and someone create a batch that make as below : 1- but... (4 Replies)
Discussion started by: fofatoti
4 Replies

5. Shell Programming and Scripting

Please explain this

cat $BDDATA/svucon$i_bal_dup_email.dat ; uuencode $dup_in $dup_out here svucon$i_bal_dup_email.dat ??? and uuencode ?? Please use and tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks. (2 Replies)
Discussion started by: Diddy
2 Replies

6. Shell Programming and Scripting

Can anyone please explain this??

cur_fy=`grep "CONSOL" $GLDATA/parms/cur_fiscalyear.lis | awk '{print $2}' Here i don't understand "CONSOL" and awk'{print$2) Please help me out cur_fiscalyear.lis contents : DL 2011 MOL 2011 MV 2011 SF 2010 CONSOL 2011 MVU 2011 (3 Replies)
Discussion started by: Diddy
3 Replies

7. UNIX for Dummies Questions & Answers

Explain the difference between the commands cd ~smart and cd ~/smart

Is it possible for both commands to work? (1 Reply)
Discussion started by: phunkypants
1 Replies

8. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

9. Programming

code that reads commands from the standard i/p and executes the commands

Hello all, i've written a small piece of code that will read commands from standard input and executes the commands. Its working fine and is execting the commands well. Accepting arguments too. e.g #mkdir <name of the directory> The problem is that its not letting me change the directory i.e... (4 Replies)
Discussion started by: Phrozen Smoke
4 Replies

10. Shell Programming and Scripting

can anyone explain this?

:start /@~/{ h s/\(.*\)@~.*$/\1/ s/@~$// s/@~/\ /g p g s/.*@~\(.*\)/\1/ } //{ N s/\n/ / b start } (2 Replies)
Discussion started by: djkane
2 Replies
Login or Register to Ask a Question