Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ashshellに単一の番号を保持するファイルを読み取ろうとしています。そうするためのbashの方法
ARG=`cat /tmp/tempfile`
は機能せず、このコード行の後にARGは何も保持しないことがわかります。
最初の改行で停止しないように、引用符で囲んでみてください。
ARG="`cat /tmp/tempfile`"
また
ARG="$(cat /tmp/tempfile)"
read ARG </tmp/tempfile #only 1st line will be read