为什么尾巴在这里不起作用?

Ric*_*lev -1 linux bash csh

我的csh脚本

#!/bin/csh
# C-schell script to increase the boundingbox....

echo '%\!PS-Adobe-3.0 EPSF-3.0'
echo '%%BoundingBox: 0 0 1100 1100'
tail +3 $argv[1]
Run Code Online (Sandbox Code Playgroud)

叫这里

csh bbox.csh plt >! plt_P1.ps
Run Code Online (Sandbox Code Playgroud)

但是我有

csh -f bbox.csh plt
tail: cannot open ‘+3’ for reading: No such file or directory
Run Code Online (Sandbox Code Playgroud)

该怎么tail办?编写代码的人使用Darwin,我在Ubuntu 14.04上.

jof*_*fel 5

GNU tail不支持此语法.请tail -n +3 "$argv[1]"改用.

如果您使用例如bash,dash或zsh作为shell:您还需要在命令行中修改>!to >:

csh bbox.csh plt > plt_P1.ps
Run Code Online (Sandbox Code Playgroud)