我想通过命令行提示用户并询问需要使用头部或尾部从数据文件中剪切哪些特定行。我的脚本将使用 head 和 tail 使用输入作为 head 和 tail 命令的变量。到目前为止,这是我所拥有的错误消息:
echo -n "What rows need to be cut from your data file: "
read before
read after
head -n $before /home/rent_list
tail -n $after /home/rent_list
错误信息:
-bash: ./rent_list: bin/bash: bad interpreter: No such file or directory
更新:这就是我现在得到的:
What rows need to be cut from your data file: 4
Mack Tools Milwaukee Wisconsin mj414@yahoo.com 414 2248893
Terry Tools Orlando Florida 407@yahoo.com 407 2439812
Park Tools Riviera Beach Florida tp123@hotmail.com 516 5370923
Bike Tools Orlando Florida baptiste41@gmail.com 407 3420983
tail: /home/renter_list: invalid number of lines