如何讀取文本文件並將其保存到bash中的變量中?我的代碼是在這裏:將文本文件保存在變量中bash
#!/bin/bash
TEXT="dummy"
echo "Please, enter your project name"
read PROJECT_NAME
mkdir $PROJECT_NAME
cp -r -f /home/reza/Templates/Template\ Project/* $PROJECT_NAME
cd $PROJECT_NAME/Latest
TEXT = `cat configure.ac ` ## problem is here !!!
CHANGED_TEXT=${TEXT//ProjectName/$PROJECT_NAME}
echo $CHANGED_TEXT
[讀取文件並將其保存在使用shell腳本的變量中]的可能重複(http://stackoverflow.com/questions/7427262/read-a-file-and-save-it-in-variable-using- shell腳本) – 2014-03-24 09:01:51