shell 文件传 参数

n cross-platform, lowest-common-denominator sh you use:

#!/bin/sh
value=`cat config.txt`
echo "$value"

In bash or zsh, to read a whole file into a variable without invoking cat:

#!/bin/bash
value=$(<config.txt)
echo "$value"
posted @ 2017-10-17 15:18  kakaisgood  阅读(319)  评论(0编辑  收藏  举报