Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 为什么要拖尾-";数据库日志文件没有';t工作和给予;尾部:无法打开输入“;_Bash_Tail - Fatal编程技术网

Bash 为什么要拖尾-";数据库日志文件没有';t工作和给予;尾部:无法打开输入“;

Bash 为什么要拖尾-";数据库日志文件没有';t工作和给予;尾部:无法打开输入“;,bash,tail,Bash,Tail,我正在制作一个bash脚本来grep数据库日志文件的最后n个字节以搜索错误 tail -c 271 prod/BOPRD2/orasrc12/diag/rdbms/boprd2/BOPRD2/trace/alert_"$ORACLE_SID".log 不工作,并出现以下错误: tail: cannot open input 正确的tail命令是: tail -n 271 prod/BOPRD2/orasrc12/diag/rdbms/boprd2/BOPRD2/trace/alert_"$O

我正在制作一个bash脚本来grep数据库日志文件的最后n个字节以搜索错误

tail -c 271 prod/BOPRD2/orasrc12/diag/rdbms/boprd2/BOPRD2/trace/alert_"$ORACLE_SID".log
不工作,并出现以下错误:

tail: cannot open input

正确的
tail
命令是:

tail -n 271 prod/BOPRD2/orasrc12/diag/rdbms/boprd2/BOPRD2/trace/alert_"$ORACLE_SID".log

-c
替换为
-n

如果没有-c,它是否工作?您的文件是普通文件还是某种管道/插座?能否编辑您的帖子,并包含您运行的确切命令及其提供的确切输出?@nneonno是的,它不带“-c”选项。这是正常的file@thatotherguy命令写在括号之间。下面是它给出的输出。@Yuki当我运行命令
tail-cn“日志文件的完整路径”
时,我得到了输出
tail:invalid number of bytes:'n'
。请编辑您的帖子,包括您运行的确切命令,以及它提供的确切输出。请避免修改或解释该命令,而是复制粘贴它。如果您觉得无法共享该命令,请在运行之前而不是之后对其进行编辑。看见