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
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT OSF1
doupdate
curs_refresh(3) Library Functions Manual curs_refresh(3)
NAME
curs_refresh, doupdate, redrawwin, refresh, wrefresh, wnoutrefresh, wredrawln - Refresh Curses windows and lines
SYNOPSIS
#include <curses.h>
int doupdate(
void ); int redrawwin(
WINDOW *win ); int refresh(
void ); int wrefresh(
WINDOW *win ); int wnoutrefresh(
WINDOW *win ); int wredrawln(
WINDOW *win,
int beg_line,
int num_lines );
LIBRARY
Curses Library (libcurses)
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
doupdate, redrawwin, wredrawln, refresh, wrefresh, wnoutrefresh: XCURSES4.2
Refer to the standards(5) reference page for more information about industry standards and associated tags.
DESCRIPTION
Applications must call the refresh and wrefresh routines (or the wnoutrefresh and doupdate routines) to get any output on the terminal.
Other Curses routines only manipulate data structures. The wrefresh routine copies the specified window to the physical terminal screen,
taking into account what is already there in order to do optimizations. The refresh routine does the same operation on stdscr. Unless
leaveok is enabled, Curses leaves the physical cursor of the terminal at the location of the cursor for that window.
The wnoutrefresh and doupdate routines allow multiple updates with more efficiency than wrefresh alone. In addition to all the window
structures, Curses keeps two data structures representing the terminal screen: a physical screen, describing what is actually on the
screen, and a virtual screen, describing what the programmer wants to have on the screen.
The routine wrefresh works by first calling wnoutrefresh, which copies the specified window to the virtual screen, and then calling doup-
date, which compares the virtual screen to the physical screen and does the actual update. If the programmer wants to output several win-
dows at once, a series of calls to wrefresh results in alternating calls to wnoutrefresh and doupdate, causing several bursts of output to
the screen. If the program first calls wnoutrefresh for each window, it is then possible to call doupdate once, resulting in only one
burst of output, with transmission of fewer characters overall and less use of CPU time. If the win argument to wrefresh is the global
variable curscr, Curses immediately clears the screen and repaints the window from scratch.
The redrawwin routine tells Curses that some screen lines are corrupted and should be thrown away before anything is written over them.
This routine could be used in programs, such as editors, that need a command to redraw some part of the screen or the entire screen. The
routine redrawln is preferred over redrawwin where a noisy communication line exists, and redrawing the entire window could be subject to
even more communication noise. In this case, redrawing only several lines offers the possibility that they would appear unblemished.
NOTES
The header file <curses.h> automatically includes the header file <stdio.h>.
Note that refresh may be a macro.
RETURN VALUES
All routines return the integer ERR upon failure and OK upon successful completion.
SEE ALSO
Functions: curses(3), curs_outopts(3)
Others: standards(5)
curs_refresh(3)