0

cat/column 環境で、ファイルのリストを 1 行で出力する必要があります。問題は次のとおりです。複数行で出力されます。

#!/bin/bash

Files=`ls ~/`

echo $Files # prints in one line as I want. But I have to do it inside cat/column:

# prints files in column -- despite column separator is &:
cat << EO | column -s\& -t

$Files

EO
4

1 に答える 1

2

なしでも同じ効果を得ることができますcat:

echo $Files | column -s\& -t

これは問題を与えcatません。


その入力については、リンクで与えられています:

    column -s\& -t <(echo "  -a, --all & apply the sed script to files in current dir and subdirs
-d, --dirs & apply the sed script to first-level-dir names
-f, --file & apply the sed script to a given file. It is a single command, but the script keep You from getting into manuals
-h, --help & show this output
-s, --script & the sed script to be used (currently: `ls $(dirname $0)/scripts`)
-v, --version & show version information
-I, --noi & overwrite existing files")

動作します。

于 2012-12-19T18:03:34.733 に答える