It don't know what is the exact source of your problem, but your code is in unspecified territory here.
function tj() is not standard function definition syntax, it's neither Bourne/POSIX syntax (which uses
tj()) not Korn syntax (which uses
function tj without
()). Some shells (bash, zsh, pdksh) do support it mostly by accident.
tail -100f is unspecified by POSIX. The POSIX syntax is
tail -f -n 100
tail takes at most one argument, the behaviour is unspecified if you pass more than one argument. Some implementations like GNU
tail are able to watch more than one file in parallel, but many others don't. You could try installing tail-like commands designed for that like
$(find...) invokes the split+glob operator, so with the default value of
$IFS, that would not work properly if any of the file paths contain space, tab, newline or wildcard characters. If
find returns no file, it would also end-up
Here you could use
zsh and define the command as
tj() multitail ./**/*.o$1(.)
It would report an error if there was no matching file (as opposed to
tailing stdin). Also note that contrary to
find, it gives you a sorted list of files and skips hidden files or files in hidden directories (add the
D glob qualifier if you want them).
Now, if, as per your edit, you see
> when you run
> is the default secondary prompt (
$PS2), it looks more likely that you have an alias also defined for
tj (that alias probably defined after the definition of the
tj function or otherwise that would have caused an error in the definition of the
For instance, it's the kind of thing you'd see if you had run:
alias tj='for sure'
for loop), or any code that is not self contained and for which the shell would issue a secondary prompt for you to finish it.
You can undefine that alias with
unalias tj (and remove its definition from your
~/.bashrc if it's there so it doesn't come back the next time you run
Of course, there's also always the possibility that the only
*.o1234 file found contains just