user2347191
user2347191

Reputation: 99

how to use find -exec command with {} option

How to display argument values using -exec option. I want to display like -

    jsvn sd/SQL
    jsvn sd/SQL/mxtools
    jsvn sd/SQL/qatools

but the below one doesn't satisfy.

/SQL 113>find $PWD -type d  -exec echo "jsvn sd"{} \;
jsvn sd{}
jsvn sd{}
jsvn sd{}

but when i use space It works but It doesn't satisfy the req.

/SQL 114>find $PWD -type d  -exec echo "jsvn sd" {} \;
jsvn sd /SQL
jsvn sd /SQL/tools1
jsvn sd /SQL/tools2

Upvotes: 0

Views: 301

Answers (1)

jlliagre
jlliagre

Reputation: 30833

find $PWD -type d -exec printf "jsvn sd%s\n" {} +

Upvotes: 1

Related Questions