On Mon, Jan 30, 2017 at 5:43 AM, Henning Reich <f...@qupfer.de> wrote:
>
> I want to use the results of 'find' and also for output naming.
> My first try/idea looks like
>
> find /search/path -iname "*.pcap" -exec /path/to/tool  -para1 "{}"
> -para2 /tmp/results(basename "{}")
>
> But this will resolve para2 with /tmp/results/search/path/name and not
> /tmp/results/name.
> What I am doing wrong?
>

The problem is that the command substitution (the thing between the parens)
is run once when you press [enter]. It is not run for each matching file
name. You need to do this via a script. Something like (untested):

find /search/path -iname "*.pcap" -print0 | while read -z path
    set -l basename (basename $path)
    /path/to/tool  -para1 $path -para2 /tmp/results/$basename
end

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to