[ 
https://issues.apache.org/jira/browse/HADOOP-7494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13086282#comment-13086282
 ] 

XieXianshan commented on HADOOP-7494:
-------------------------------------

Thanks Daryn.
Yes,the code seems not working well for these scenarios.
* "tail \-c \+\-10 file"
  Long.parseLong("-10") will be ok while "+" removed by the code "arg = 
arg.substr(arg,1)".The fact is that the number of bytes is invalid for tail -c. 
* "tail \-c \-\+10 file"
  Long.parseLong("-+10") will throw an exception.But it should be a valid 
number of bytes.

Therefore,i added some code to process them.

> 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-v0.3.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

        

Reply via email to