Hi Dmitry,
for file in "$logfile".*; do
[ -f "$file" ] || continue
- suffix=${file:1+$pfxlen}
- [ "$suffix" -gt 0 ] 2> /dev/null || {
- echo "Skipped file '$file' (bad suffix)" >&2
+ suffix=${file#$logfile.}
suffix=${file#$logfile.} is not a good way to strip $logfile prefix:
${var#pattern} operation interprets <pattern>, indeed, as glob pattern.
Even if it is inside a variable.
Try this:
logfile="????"
file=FILE.123
suffix=${file#$logfile.}
echo "$suffix"
It will print "123" - thus, it "removed the prefix and the dot",
but it is wrong: string "FILE.123" hasn't got the "????" prefix!
The bug is not very dangerous (who in their right mind would use
? and * in actual filenames?) but nevertheless, it's a bug.
I think we'd better use suffix=${file:1+$pfxlen}.
--
vda
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel