题解 | #输出第5行的内容#
输出第5行的内容
https://www.nowcoder.com/practice/1d5978c6136d4252904757b4fa0c9296
#!/bin/bash
if [ -f nowcoder.txt ]; then
line=$(sed -n '5p' nowcoder.txt)
echo $line
else
echo "File nowcoder.txt does not exist."
fi
输出第5行的内容
https://www.nowcoder.com/practice/1d5978c6136d4252904757b4fa0c9296
#!/bin/bash
if [ -f nowcoder.txt ]; then
line=$(sed -n '5p' nowcoder.txt)
echo $line
else
echo "File nowcoder.txt does not exist."
fi
相关推荐