Re: list textfile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Do, den 19.05.2005 schrieb roland brouwers um 17:57:

> This line
> $ awk '{ print substr(FILENAME, 1, 1) $0 }' $(ls -rt) > /path/to/output
> 
> puts the first char of filename on a separated line.
> How do I remove this linefeed, like echo -n does, so both will appear on
> the same line?
> 
> This will generate a linux textfile, I suppose. Is there a way of
> turning it into a Windows file with CrLf without using unix2dos?
> 
> Thanks again
> Roland

A different approach:

> list.txt
for i in $(ls -rt); do echo ${i} | cut -b1 | tr "\n" " " >> list.txt;
done

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG http://pgp.mit.edu 0xB366A773
legal statement: http://www.uni-x.org/legal.html
Fedora Core 2 GNU/Linux on Athlon with kernel 2.6.11-1.14_FC2smp 
Serendipity 18:17:55 up 5 days, 17:49, load average: 0.25, 0.14, 0.10 

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux