1
我想通过命令行&提示用户使用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 [email protected] 414 2248893
Terry Tools Orlando Florida [email protected] 407 2439812
Park Tools Riviera Beach Florida [email protected] 516 5370923
Bike Tools Orlando Florida [email protected] 407 3420983
tail: /home/renter_list: invalid number of lines
感谢ruakh,我固定环境变量.. – demet8
感谢ruakh,这就是我需要知道。 – demet8
@ demet8:不客气! – ruakh