I have the following line which is not working in ksh but works fine in sh:
cat `find /home/peter/databases -name "cells.txt"`
This is working if this line is inside /usr/bin/sh script. But not when it is inside /usr/bin/ksh.
Any hint why this is so?
I am using:
SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 4
"Not working" means the script hangs (something like the behaviour if cat
is not provided with the file name as parameter)
The output of find /home/peter/databases -name "cells.txt"
is NOT empty in the ksh script. In this case, the script is able to list the found files. But the problem comes if I try catting the found files using back quotes as mentioned above.
There are nearly 1000 files listed with find command, but most of them are empty. The above said cat command is working in sh but not in ksh.
- There are no files with the name spaces including in them.
- The content of the file cells.txt is either empty or single statement.
- The command (cat `find /home/peter/databases -name "cells.txt"`) works fine if the number of files under /home/peter/databases are less. In this case the number of files is 1000.
- The same command is working in SUSE 11.3 ksh. But fails if I execute it under SUSE 11.4.
- I kept only few files with the name cells.txt in the directories under /home/peter/databases, the command is working perfectly fine. When the files with the name cells.txt grows to a number of about 1000 then the command doesn't give any output(hangs). I suspect is it because of some buffer used for the output back quote? (``) Because the SUSE 11.3 doesn't have any issue but 11.4 hangs.
- The command worked with the option
-size +0
along with find. Is it indicating again that something about buffer?
find /home/peter/databases -name "cells.txt"
is empty in the ksh script./bin/cat
? Note thatcat
is aksh
builtin.echo `find /home/peter/databases -name "cells.txt"`
in the script?find
, which you say is nearly a thousand files. Usefind
's-exec
withcat
, instead.