#! /bin/bash
read filename
read url
if test -w $filename && [ -n $url ]
then
echo $url>$filename
echo "write succ"
else
echo "write fail"
fi
脚本输出结果:
#! /bin/bash
read filename
read url
if test -w $filename && [ -n $url ]
then
echo $url>$filename
echo "write succ"
else
echo "write fail"
fi
脚本输出结果: