Ok, this is driving me a bit nuts.
I'm trying to watch the number of files in a set of subdirectories.
find . | wc -l correctly returns the number of sub-folders and files.
watch 'find . | wc -l' returns
watch: find . | wc -l: No such file or directory in the watch screen.
It returns the same with double-quotes, or backquotes (`).
This is on an ancient version of bash:
GNU bash, version 3.00.16(2)-release (i486-slackware-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.
This is also an embedded device, so it's running busybox (
BusyBox v1.1.0 (2010.06.14-02:47+0000) multi-call binary) rather then the normal gnu utils, so most of the switches and functionality of most of the common tools is not there either.
So that has to be taken into account. However, the linux install is baked onto a disk-on-module, so there is no easy way to update it.
The same command (
watch 'find . | wc -l') works correctly on a more recent linux install, so this question is more about dealing with out-of-date bash then what is wrong with this exact snippet (since it seems to be correct elsewhere!).