![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| String search - Command to find second occurance | saurabhsinha23 | UNIX for Dummies Questions & Answers | 5 | 12-06-2007 05:03 PM |
| Problems with find command | lodey | UNIX for Dummies Questions & Answers | 4 | 10-27-2007 04:47 AM |
| Unix find command to print directory and search string | princein | UNIX for Dummies Questions & Answers | 4 | 03-06-2007 05:46 AM |
| Looking for command(s)/ script to find a text string within a file | wrwelden | Shell Programming and Scripting | 5 | 11-22-2006 09:53 PM |
| ctrl-c: not escaping command | dangral | UNIX for Dummies Questions & Answers | 3 | 06-23-2004 01:36 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
find: problems escaping printf-command string
Hi Folks!
Can you help me with this find -printf command. I seem to be unable to execute the printf-command from my shell script. I'm confused: My shell script snippet looks like this: Code:
#!/bin/sh
..
COMMAND="find ./* -printf '%p %m %s %u %g \n'"
echo "Command: ${COMMAND}"
${COMMAND} > ${ARCHIVE_DIR}/${CURRENT_FILE}
Code:
Command: find ./* -printf '%p %m %s %u %g \n' find: paths must precede expression Look forward to your replies Grahamb Using Fedora2.54 with bash; and #!/bin/sh for shell execution |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Hi You Guys!
I'm sure most of you have an answer to this one. Here's my next stopper: Code:
COMMAND="ls -la --full-time `find ./* -type f` "
${COMMAND} | awk '''{ print '$NF' '$0' }''' >> ${ARCHIVE_DIR}/${TMP_FILE}
Code:
+ awk '{ print /usr/share/scripts/security_check.sh }'
When I put \$NF inside the awk-brackets the "\" gets sent to the command line, eg: Code:
+ awk '{ print \$NF \$0 }'
Can u help? Any ideas? Any links to help me? regards GrahamB |
|||
| Google The UNIX and Linux Forums |