Fahrvergnuugen
I am the law!
I'm trying to write a simple shell script (basically as a learning exercise) that will pipe the out put of find to a command that takes two arguments (such as cp for example)
Here's the closest I've gotten
for some reason, the contents of $1 are truncated right at the space.
EXAMPLE
will output this:
/Users/reloaded/Documents/test/file\ with\ space.txt
will output this:
/Users/reloaded/Documents/test/file\
How can I fix this?
Here's the closest I've gotten
find ~/path/to/dir -name "*.txt" -print | replace " " "\ " | awk '{print $1}'
for some reason, the contents of $1 are truncated right at the space.
EXAMPLE
find ~reloaded/Documents/test -name "*.txt" -print | replace " " "\ "
will output this:
/Users/reloaded/Documents/test/file\ with\ space.txt
find ~reloaded/Documents/test -name "*.txt" -print | replace " " "\ " | awk '{print $1}'
will output this:
/Users/reloaded/Documents/test/file\
How can I fix this?