[Last Call] Learn how to a build a cloud-first strategyRegister Now


Linux shell variable help

Posted on 2004-11-07
Medium Priority
Last Modified: 2010-03-18

This is probably a real no brainer for someone with experience in shell scripts but,

I am new to Linux and scripting and was wondering if someone can explain to me what the following statements do?

Specifically what is .$$

If you could take it line by line that would be extremely helpful.

echo "RZ_ISSUE_NAME     $*" > $TMP
echo "RZ_ISSUE_VER      $*" >> $TMP
cat $* >> $TMP
rz_issue_summarize_file $TMP > $TFILE1

thanks in advance,


Question by:dprice7
  • 2
LVL 15

Accepted Solution

scampgb earned 300 total points
ID: 12518321
Hi dprice7,

I can't say that I'm an expert shell-scripter, but I'll offer the help I can :-)

> Specifically what is .$$

$$ is the PID (process ID) of the process that's running.  Example:
echo $$
...will give you the PID of the shell that you executed the echo command from.  Does that make sense?

$* means the parameters that were put on the command-line of the script

In your example below, I'll assume that your PID is 13900  and that the command-parameter was "BANANA"
'scuse the formatting :-)

TMP=/tmp/new_issue.$$                                                               --- variable TMP now equals /tmp/new_issue.13900
TFILE1=$TMP.1                                                                               -- variable TFILE1 now equals /tmp/new_issue.13900.1
TFILE2=$TMP.2                                                                                -- variable TFILE1 now equals /tmp/new_issue.13900.1
echo "RZ_ISSUE_NAME     $*" > $TMP                                      -- append "RZ_ISSUE_NAME      BANANA" to  /tmp/new_issue.13900
echo "RZ_ISSUE_VER      $*" >> $TMP                                     -- append "RZ_ISSUE_VER      BANANA" to  /tmp/new_issue.13900
cat $* >> $TMP                                                                                  -- append "BANANA" to  /tmp/new_issue.13900
rz_issue_summarize_file $TMP > $TFILE1                              --- I don't know what rz_issue_summarize_file does, so can't comment on this

Does that help to explain it?


Author Comment

ID: 12518382
Hi scampgb,

thanks much!

LVL 15

Expert Comment

ID: 12518384
Glad I could help.  Good luck with the scripting :-)

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month18 days, 4 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question