04-08-2013
Quote:
Originally Posted by
ahamed101
I mean, when things can be done with just a one liner, sometimes I tend to forgot those simple things and go for unwanted iterations.
And that's why i like UNIX Philosophy .
Quote:
Originally Posted by
ahamed101
May be our brain misses something sometimes and thinks too complex?
I think the thing that most programmers missing while programming is : KISS principle :-)
4 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
This link might help whom is seeking a quick solutions for thier daily shell needs.
linkAll commands | commandlinefu.com (1 Reply)
Discussion started by: h@foorsa.biz
1 Replies
2. Shell Programming and Scripting
Guys,
I have a requirement like this.
A file has >5K records always. Separated by "|", it has 30 fields for each line. In some lines, I am getting an odd field. say, the 15th field is supposed to be 2 characters but comes in as >2. In this case, for resolving this I need to copy the value of... (6 Replies)
Discussion started by: PikK45
6 Replies
3. Shell Programming and Scripting
Hi All,
I got some awk one liners, how can i split it all into a nice script?
Got these:
gzcat capgw0.log-201308161376632741.gz | sed -n '/2013-08-16 05:56:/,/2013-08-16 05:58:/p' > timebased.log
awk -F":|," 'FNR==NR && /INFO - AId:/ {a=$0;next} END {for (i in a) print i "|" a}'... (8 Replies)
Discussion started by: batka
8 Replies
4. What is on Your Mind?
Hi fellas and fella-esses...
There are numerous threads on here where people ask for, and often expect, solutions to difficult problems solved using _one_liners_.
Why do they insist as such when it is virtually no different in execution time with well thought out indented code?
Is it me... (12 Replies)
Discussion started by: wisecracker
12 Replies
LEARN ABOUT MINIX
ppmtopgm
ppmtopgm(1) General Commands Manual ppmtopgm(1)
NAME
ppmtopgm - convert a portable pixmap into a portable graymap
SYNOPSIS
ppmtopgm [ppmfile]
DESCRIPTION
Reads a portable pixmap as input. Produces a portable graymap as output. The output is a "black and white" rendering of the original
image, as in a black and white photograph. The quantization formula used is .299 r + .587 g + .114 b.
Note that although there is a pgmtoppm program, it is not necessary for simple conversions from pgm to ppm , because any ppm program can
read pgm (and pbm ) files automatically. pgmtoppm is for colorizing a pgm file. Also, see ppmtorgb3 for a different way of converting
color to gray. And ppmdist generates a grayscale image from a color image, but in a way that makes it easy to differentiate the original
colors, not necessarily a way that looks like a black and white photograph.
QUOTE
Cold-hearted orb that rules the night
Removes the colors from our sight
Red is gray, and yellow white
But we decide which is right
And which is a quantization error.
SEE ALSO
pgmtoppm(1),ppmtorgb3(1),rgb3toppm(1),ppmdist(1),ppm(5),pgm(5)
AUTHOR
Copyright (C) 1989 by Jef Poskanzer.
10 April 2000 ppmtopgm(1)