shell/理解输入和输出/在tmp目录创建临时文件.sh

13 lines
249 B
Bash
Raw Normal View History

2016-05-15 09:51:46 +08:00
#!/bin/bash
# creating a temp file in /tmp
tempfile=`mktemp -t tmp.XXXXXX`
echo "This is a test file" > $tempfile
echo "This is the second line of the test" >> $tempfile
echo ”The temp is locate at : $tempfile
cat $tempfile
rm -f $tempfile