Это будет работать:
sed '' -- *
Вам не нужны никакие циклы оболочки или что-то еще, и это всегда будет следовать за выводом файла с \n
ewline - за исключением, возможно, самого последнего.
Иначе, если вы хотите, чтобы между выводами каждого файла выводилась пустая строка, это может сработать:
bpaste(){
eval "paste -'sd\n' -- $(x=0;for f do printf "\"\${$((x+=1))}\" - ";done)"
} </dev/null
Это всегда будет следовать за выводом файла с \n
ewline и дополнительной пустой строкой.
Вы можете назвать это так:
bpaste *
Спецификация POSIX для командного языка оболочки, раздел 2.7, перенаправление , гласит
The overall format used for redirection is:
[n] redir-op wordThe number n is an optional decimal number designating the file descriptor number; …
︙
… The values 0, 1, and 2 have special meaning and conventional uses and are implied by certain redirection operations; they are referred to as standard input, standard output, and standard error, respectively. …︙
The general format for redirecting input is:
[n ]<wordwhere the optional n represents the file descriptor number. If the number is omitted, the redirection shall refer to standard input (file descriptor 0).
… и аналогичный абзац, в котором говорится, что >
эквивалентно 1>
, со ссылкой на стандартный вывод.