Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1A40C200ACC for ; Mon, 2 May 2016 17:32:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 190981609A6; Mon, 2 May 2016 17:32:15 +0200 (CEST) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6C83E1609B1 for ; Mon, 2 May 2016 17:32:14 +0200 (CEST) Received: (qmail 92322 invoked by uid 500); 2 May 2016 15:32:13 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 92153 invoked by uid 99); 2 May 2016 15:32:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 May 2016 15:32:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E9C882C1F60 for ; Mon, 2 May 2016 15:32:12 +0000 (UTC) Date: Mon, 2 May 2016 15:32:12 +0000 (UTC) From: "Allen Wittenauer (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-13079) Add -q to fs -ls to print non-printable characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 02 May 2016 15:32:15 -0000 [ https://issues.apache.org/jira/browse/HADOOP-13079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15266799#comment-15266799 ] Allen Wittenauer commented on HADOOP-13079: ------------------------------------------- No way should -q be the default under any circumstances. That is *extremely* surprising behavior that will definitely break stuff. > Add -q to fs -ls to print non-printable characters > -------------------------------------------------- > > Key: HADOOP-13079 > URL: https://issues.apache.org/jira/browse/HADOOP-13079 > Project: Hadoop Common > Issue Type: Bug > Reporter: John Zhuge > Assignee: John Zhuge > Labels: supportability > > Add option {{-q}} to "hdfs dfs -ls" to print non-printable characters as "?". Non-printable characters are defined by [isprint(3)|http://linux.die.net/man/3/isprint] according to the current locale. > Default to {{-q}} behavior on terminal; otherwise, print raw characters. See the difference in these 2 command lines: > * {{hadoop fs -ls /dir}} > * {{hadoop fs -ls /dir | od -c}} > In C, {{isatty(STDOUT_FILENO)}} is used to find out whether the output is a terminal. Since Java doesn't have {{isatty}}, I will use JNI to call C {{isatty()}} because the closest test {{System.console() == null}} does not work in some cases. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org