我有这个:
sed -i '/^$/d' temp_spec.rb
Run Code Online (Sandbox Code Playgroud)
这是剥离空行并且运行良好。我怎样才能让它只对第 5-999 行(或理想情况下 5 行到文件尾)执行此操作。
我试过:
sed -n5,999 -i '/^$/d' temp_spec.rb
sed '5,999!d/^$/d' temp_spec.rb
Run Code Online (Sandbox Code Playgroud)
但都没有工作(没有错误)。
sed ×1