[root@localhost ~]# cat xingfu.sh
#! /bin/bash
cd /home/xingfu
touch xingfu.txt
echo “I love you” >>xingfu.txt[root@localhost ~]# cd /home/xingfu/
[root@localhost xingfu]# ls -ltr
total 4
-rw-r–r--. 1 root root 11 May 22 22:15 xingfu.txt
[root@localhost xingfu]#
[root@localhost xingfu]#
[root@localhost ~]# cd /home/xingfu/
[root@localhost xingfu]# cat xingfu.txt
I love you
[root@localhost xingfu]#