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}
With or without the single quotes enclosing the %p, etc, I get this error message:
Code:
Command: find ./* -printf '%p %m %s %u %g \n'
find: paths must precede expression
At the command line (bash), the command works. Further-more it only works for me with the single quotes enclosing the printf-command string.
Look forward to your replies
Grahamb
Using Fedora2.54 with bash; and #!/bin/sh for shell execution