On 07/13/2014 02:26 AM, ToddAndMargo wrote:
Hi All,

In bash script, I don't seem to be able to call a function
from "find -exec".   What am I doing wrong?  (Google is of
no help.)

Many thanks,
-T

cat ./eraseme
#!/bin/bash

Test () {
  echo "$1" | sed -e "s/\/home//"
}

Test "/home/CDs/Keepers/Linux/bash/grep_if_examples.txt"
find /home/CDs/Keepers/Linux/bash -exec Test {}   \;




$ ./eraseme
/CDs/Keepers/Linux/bash/grep_if_examples.txt
find: `Test': No such file or directory


Never mind.  I just figured it out.  "find" is
not a bash command.  It is an external command
and would know a thing about the internal
function.  Duh.

Reply via email to