[
https://issues.apache.org/jira/browse/HADOOP-7494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13078685#comment-13078685
]
XieXianshan commented on HADOOP-7494:
-------------------------------------
Thanks for your comments,@Daryn & @Allen.
I have updated the patch according to your comments.
And i think the pattern match is necessary because the error msg displayed by
parseLong() is strange if bytes specified like this -c+-10 or -c+10+.
(Error msg: tail: For input string: "0-10" vs. tail: +-10: invalid number of
bytes.)
Refer to the style of linux command tail,0 byte skipped when -c+1
specified,hence, i subtracted 1 when the offset is positive.And I removed this
logic in the newest patch for more comprehensive.
parseLong() will throw an exception if large values specified.
> Add -c option for FSshell -tail
> -------------------------------
>
> Key: HADOOP-7494
> URL: https://issues.apache.org/jira/browse/HADOOP-7494
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs
> Affects Versions: 0.23.0
> Reporter: XieXianshan
> Assignee: XieXianshan
> Priority: Trivial
> Fix For: 0.23.0
>
> Attachments: HADOOP-7494-v0.2.patch, HADOOP-7494.patch
>
>
> Add the "-c" option for FSshell -tail to allow users to specify the output
> bytes(currently,it's -1024 by default).
> For instance:
> $ hdfs dfs -tail -c -10 /user/hadoop/xiexs
> or
> $ hdfs dfs -tail -c+10 /user/hadoop/xiexs
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira