Sponsored Content
Operating Systems AIX ls command output in single line Post 302190045 by bakunin on Monday 28th of April 2008 02:36:34 PM
Old 04-28-2008
reborg wrote about eras usage of "ls -1":

Quote:
Originally Posted by reborg
The -1 option serves no purpose here.
This is a common misunderstanding about "ls". Because "ls" output has several columns when displayed on a screen one would assume that the same is the case when the output goes into a pipe. In fact "ls" determines if its output goes to a terminal or not and formats its output in columns or not. This can easily be demonstrated by issuing "ls > /some/file ; cat /some/file", which will show the same output as "ls -1" (to the screen), whereas "ls" (to the screen) will look different.

(source: the AIX manpage of ls tells about this rather counter-intuitive behavior of ls)

bakunin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multi-line output to single line

Hello, How can I take the following output: outputa outputb outputc and turn it into single line ouput, with a single space between each field like below: outputa outputb outputc (7 Replies)
Discussion started by: LinuxRacr
7 Replies

2. Shell Programming and Scripting

single line input to multiple line output with sed

hey gents, I'm working on something that will use snmpwalk to query the devices on my network and retreive the device name, device IP, device model and device serial. I'm using Nmap for the enumeration and sed to clean up the results for use by snmpwalk. Once i get all the data organized I'm... (8 Replies)
Discussion started by: mitch
8 Replies

3. Shell Programming and Scripting

How to print the output in single line

Hi, Please suggest, how to get the output of below script in single line, its giving me in different lines ______________________ #!/bin/ksh export Path="/abc/def/ghi"; Home="/home/psingh/prat"; cd $Path; find $Path -name "*.C#*" -newer "abc.C#1234" -print > $Home cat $Home | while... (1 Reply)
Discussion started by: Prat007
1 Replies

4. Shell Programming and Scripting

Output coming in different line instead of single line

Hi Guys, I have an oracle database, I am trying to query the database and route it to file. But the records instead of coming in a single line, are coming in three lines. Can you please help me.. in this.. sqlplus -s $SRMUserid/$SRMPassword@$SRMServer<< EOF >log.out; select * from... (5 Replies)
Discussion started by: mac4rfree
5 Replies

5. Shell Programming and Scripting

Output to be in single line

Hi All, Small script but :wall:, please help in this regard. for i in 1 2 3 do echo $i done result : 1 2 3 I want the above to be printed as below expected result: 1 2 3 Thanks in advance :) (3 Replies)
Discussion started by: girish_satyam
3 Replies

6. Shell Programming and Scripting

Merge multi-line output into a single line

Hello I did do a search and the past threads doesn't really solve my issue. (using various awk commands) I need to combine the output from java -version into 1 line, but I am having difficulties. When you exec java -version, you get: java version "1.5.0_06" Java(TM) 2 Runtime... (5 Replies)
Discussion started by: flagman5
5 Replies

7. Shell Programming and Scripting

Joining multi-line output to a single line in a group

Hi, My Oracle query is returing below o/p ---------------------------------------------------------- Ins trnas value a lkp1 x a lkp1 y b lkp1 a b lkp2 x b lkp2 y ... (7 Replies)
Discussion started by: gvk25
7 Replies

8. Shell Programming and Scripting

Output to single line

Hi, I am using below command and getting below output. echo "dis ql(*) CLUSTER"|runmqsc CT.QM.ASSA10T1| egrep 'QUEUE|CLUSTER'|egrep -v 'SYSTEM|XMITQ'| sed -e 's/QUEUE(/ /g' -e 's/TYPE(QLOCAL)/ /g' -e 's/CLUSTER(/ /g' -e 's/)/ /g' output CT.CL.ALLUHUB.FLST_TO_HUB_PROV.01... (20 Replies)
Discussion started by: darling
20 Replies

9. Shell Programming and Scripting

convert single line output to multiple line

Hi all, I have a single line output like below echo $ips 10.26.208.28 10.26.208.26 10.26.208.27 want to convert above single line output as below format. Pls advice how to do ? 10.26.208.28 10.26.208.26 10.26.208.27 Regards Kannan (6 Replies)
Discussion started by: kamauv234
6 Replies

10. UNIX for Beginners Questions & Answers

Output to file print as single line, not separate line

example of problem: when I echo "$e" >> /home/cogiz/file.txt result prints to file as:AA BB CC I need it to save to file as this:AA BB CC I know it's probably something really simple but any help would be greatly appreciated. Thank You. Cogiz (7 Replies)
Discussion started by: cogiz
7 Replies
ap(8)							      System Manager's Manual							     ap(8)

NAME
ap - Parses addresses RFC 822-style SYNOPSIS
/usr/lib/mh/ap [-form file] [-format string] [-help] [-[no]normalize] [-width columns] addrs... OPTIONS
Overrides the default output format of ap. The output is formatted according to the instructions in the specified file. This must be a format file; see mh-format(4). Overrides the default output format of ap. The output is formatted according to the instructions in the specified string. This must be a format string; see mh-format(4). The argument to the -format option must be interpreted as a single token by the shell that invokes ap. Therefore, you should usually place the argument to this option inside double quotes ("). Prints a list of the valid options to this command. The -normalize option tells ap to try to find the official host name of the address. This is the default behavior, which can be suppressed using the -nonormalize option. Specifies the width of the screen in columns. DESCRIPTION
The ap program parses addresses according to the ARPA Internet standard. It also understands many nonstandard formats. It is useful for seeing how MH will interpret an address. The ap program treats each argument as one or more addresses, and prints those addresses in the official RFC 822 format. Hence, it is usu- ally best to enclose each argument in double quotes (") for the shell. In addition to the standard escapes, ap also recognizes the additional escape error, which is a diagnostic that is returned if the parsing operation failed. The default settings for the ap command are -normalize and -width columns, where columns is equal to the the width of the terminal. RESTRICTIONS
On systems where MH is configured with the BERK option, address parsing is not enabled. EXAMPLES
This is the default format string used by ap: %<{error}%{error}: %{text}%|%(proper{text})%> If an error was detected, the preceding string instructs ap to print the error, a colon (:), and the address that is in error. Otherwise, the ap command output is the proper RFC 822 format of the address. FILES
User profile. System customization file. SEE ALSO
Commands: dp(8) Files: mh-format(4) Standard for the Format of ARPA Internet Text Messages (RFC 822) ap(8)
All times are GMT -4. The time now is 06:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy