Re: bash oom problem

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

 



Patrick O'Callaghan wrote:
> On Sun, 2009-10-04 at 13:54 +0100, psmith wrote:
>> do you have any suggestions what/where i should be looking to get my 
>> required output?
> 
> As Sam says, your initial attempt is trying to produce all 1.5TB at
> once, which is why it blows up, but that's going to happen anyway even
> if you program the same thing in C. IOW it's not an issue with the Shell
> per se, but with the approach to the problem.
> 
> Assuming you actually want all 1.5TB of data (really?) you'd be better
> consuming it as it's produced, perhaps via a pipe. Of course that
> depends on what you're doing with it, which you haven't said.
> 
> poc
> 
One way to do it would be to break it down into nested loops. I am
not sure you could do it in bash - I am not sure how bash handles
loops. You can try something like: (Not tested)

for a in {A..Z}; \
do for b in {A..Z}; \
do for c in {A..Z}; \
do for d in {A..Z}; \
do for e in {A..Z}; \
do for f in {A..Z}; \
echo $a$b$c$d$e$f ; \
done ; done ; done ; done ; done ; done ; done ; done

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux