2013-04-30 117 views
1

所以我试图建立在bash文件,但我得到一个奇怪的错误,这里是我的代码:猛砸无法创建文件

touch > "application/views/scripts/"$theFile"/"awk '{tolower($theFile".phtml")}' 

错误:

./zf.sh: line 16: application/views/scripts/foo/awk: No such file or directory 

我想根据用户的输入像创建一个文件:./zf.sh: line 16: application/views/scripts/foo/foo.phtml: No such file or directory

回答

1

如果你想使用周:

fn=`echo ${theFile} | awk '{print tolower($0)}'` 
touch application/views/scripts/"${fn}".phtml 
1

touch application/views/scripts/"${theFile}"/$(echo ${theFile} | tr '[:upper:]' '[:lower:]').phtml