Linux shell variable help

Posted on 2004-11-07
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
    LVL 15

    Accepted Solution

    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

    Hi scampgb,

    thanks much!

    LVL 15

    Expert Comment

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

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    „dd“ vs „ddrescue“ 28 183
    Error when calling SSH command 20 97
    apache and php 3 80
    Measure data download 1 21
    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…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now