On 2013-06-04 19:33, Matthew Cengia wrote:
[...]
> mattcen@owen:tmp$ dpkg -L mutt | while read -r file; do test -f "$file" && 
> test -x "$file" && echo "$file"; done
[...]
> Note the above command: This is how I'd find executable files in a
> package. Note echos files that are (a) a file (as opposed to a
> directory, link, etc.), and (b) are executable by the current user. See
> 'help test' for more information.

Also note that this assumes (reasonably, in this case, in my opinion)
that no filenames contain newlines. dpkg doesn't seem to have an option
to output filenames delimited with null characters rather than newlines,
and I also am unaware of a way to express this in the package file when
creating a package.

Nonetheless, if you had output that was null-delimited, that could be
parsed by changing the while loop to:

while IFS= read -rd ''; do

See http://mywiki.wooledge.org/BashFAQ/020 for more info.

-- 
Regards,
Matthew Cengia

Attachment: signature.asc
Description: Digital signature

_______________________________________________
luv-main mailing list
[email protected]
http://lists.luv.asn.au/listinfo/luv-main

Reply via email to