my variable p开发者_JAVA技巧ath1
contains the value /home/folder
. how can I create a new file named foo
using this absolute path name?
path1="/home/folder"
echo "hello web" > $path1/foo
but this code give me error. Can some one please tell me how can I create this file foo in a specific location, using a path name?
In bash you should write:
path1="/home/folder"; echo "hello web" > $path1/foo
Or:
export path1="/home/folder"
echo "hello web" > $path1/foo
Notation you used works only in bash script.
精彩评论