[root@localhost home]# vim test.sh
#!/bin/sh
# \n newline
# \r Enter
# \t
# \v
# \b backspace
# \a bip
# \xFF \x00~\xFF
CUR_DIR=`pwd`
target=$CUR_DIR/abc/list/files.txt
newline=$'\n'
newline2=$'\x0a'
a=$'\x61'
ret="$newline============ version ===========$newline"
if [ -e $target ]; then
ret+= "$(cat $target )"
else
ret+="File or directory not exist."
fi
ret+= "$newline2"
ret+= "$a"
#!/bin/sh
# \n newline
# \r Enter
# \t
# \v
# \b backspace
# \a bip
# \xFF \x00~\xFF
CUR_DIR=`pwd`
target=$CUR_DIR/abc/list/files.txt
newline=$'\n'
newline2=$'\x0a'
a=$'\x61'
ret="$newline============ version ===========$newline"
if [ -e $target ]; then
ret+= "$(cat $target )"
else
ret+="File or directory not exist."
fi
ret+= "$newline2"
ret+= "$a"
echo "$ret"
[root@localhost home]# ./test.sh
============ version ===========
Version: 1.0
Compile-Timestamp: 2017-04-10 20:01:30
Java Version: 1.6
a
[root@localhost home]#