The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 12-04-2005
grahamb grahamb is offline
Registered User
  
 

Join Date: Dec 2005
Location: Windsor, Ont Canada
Posts: 13
Question That dammed substitution!

Hi You Guys!

I'm sure most of you have an answer to this one. I'm trying to do a work around on the problem above, but get held up elsewhere!!!!! So can't avoid this problem.

Here's my next stopper:
Code:
COMMAND="ls -la --full-time `find ./* -type f` "
${COMMAND} | awk '''{ print '$NF' '$0' }''' >> ${ARCHIVE_DIR}/${TMP_FILE}
The log file shows this error:
Code:
+ awk '{ print  /usr/share/scripts/security_check.sh }'
I'm half way there. I have the '{ }' parts carried to the command line. BUT the "$NF" is substituted to be blank and "$0" is substitued as the calling program!!

When I put \$NF inside the awk-brackets the "\" gets sent to the command line, eg:
Code:
+ awk '{ print  \$NF \$0 }'
Close but not close enough!

Can u help? Any ideas? Any links to help me?

regards
GrahamB