如题:
答案如下:
#!/bin/bash
read -p "Input a filename : " filename
if [ -b "$filename" -o -c "$filename" ]
then
echo "$filename is a device file" && cp $filename /dev/ &
else
echo "$filename is not a device file" && exit 1
fi
答案如下:
#!/bin/bash
read -p "Input a filename : " filename
if [ -b "$filename" -o -c "$filename" ]
then
echo "$filename is a device file" && cp $filename /dev/ &
else
echo "$filename is not a device file" && exit 1
fi
编辑回复