I think wc is just optimized for this task. Anyway here is a little C program you can compile with your favourite C compiler, for example:
and try it out.
I have set the maximum line length to 2048 - maybe you want to increase this if it is not sufficient for your file. Maybe worth a try. I am no C programmer so maybe someone has even an idea to improve it.
It could be also the case that your hardware/OS is the bottle neck - just a guess.
Last edited by zaxxon; 10-15-2010 at 09:01 AM..
Reason: changed printf to long integer according to definition of z
I have to implement switches (options) like this in my script.
./myscript -help
./myscript -dir /home/krish -all
./myscript -all
getopts allows switches to have one character (like a, b, etc.). How can I customize it for handling the above situation? Or, is there any alternative to... (3 Replies)
i=1
while
do
mm=02
dd=03
yy=2008
echo "$mm$dd$yy"
i=$(( i+1))
echo "$i"
done
whenever i execute the script above i will get the error below:
syntax error at line 30: `i=$' unexpected (3 Replies)
I have a perl script that just does a `du -sk -x` and formats it to look groovy ( the argument can be a directory but usually is like /usr/local/* )
#!/usr/bin/perl
use strict;
use warnings;
my $sizes = `du -x -sk @ARGV | sort -n`;
my $total = 0;
print "MegaBytes Name\n";
for(split... (1 Reply)
Hello to all board members!!
I have a problem on a HP-UX system. I should write a script. Therefore I need to search after IP addresses in the output of a command.
On Debian this works: ifconfig | egrep -o "{1,3}\.{1,3}\.{1,3}\.{1,3}"
The script where i need this is not ifconfig, but... (2 Replies)
Hi Folks...
Is there an alternative for ikecert(SunOS) - man info - "manipulates the machine's on-filesystem public-key certificate databases" in linux?
Can we use pkcs7, pkcs8 or something like that?...
I also came across ssh-keygen and ssh-keygen2...
My best guess is to use ssh-certtool... (0 Replies)
I have an automated testing script that relies on the dev box being able to see production's (NFS) share. It uses rsync and ssh to handle transfers and command execution; however, it also needs the production share mounted in order to run Perl code against it when Unix commands via ssh will not do.... (2 Replies)
Is there any other editor, installed by 'default' in Sparc Solaris10, besides vi?
I'd like to avoid installing anything new.
If not, how to make vi more user-friendly?
thanks. (8 Replies)
I've created quite a collection of tcl scripts which have buttons, radio buttons, check boxes, text fields, etc. These tcl scripts in turn call and execute several hundred sh, csh, bash, perl scripts and pass in the args based on the gui selections on the same and other redhat machines. We're... (4 Replies)
Discussion started by: scottwevans
4 Replies
LEARN ABOUT MOJAVE
glpolygonmode
GLPOLYGONMODE(3G)GLPOLYGONMODE(3G)NAME
glPolygonMode - select a polygon rasterization mode
C SPECIFICATION
void glPolygonMode( GLenum face,
GLenum mode )
PARAMETERS
face Specifies the polygons that mode applies to. Must be GL_FRONT for front-facing polygons, GL_BACK for back-facing polygons, or
GL_FRONT_AND_BACK for front- and back-facing polygons.
mode Specifies how polygons will be rasterized. Accepted values are GL_POINT, GL_LINE, and GL_FILL. The initial value is GL_FILL for
both front- and back-facing polygons.
DESCRIPTION
glPolygonMode controls the interpretation of polygons for rasterization. face describes which polygons mode applies to: front-facing poly-
gons (GL_FRONT), back-facing polygons (GL_BACK), or both (GL_FRONT_AND_BACK). The polygon mode affects only the final rasterization of
polygons. In particular, a polygon's vertices are lit and the polygon is clipped and possibly culled before these modes are applied.
Three modes are defined and can be specified in mode:
GL_POINT Polygon vertices that are marked as the start of a boundary edge are drawn as points. Point attributes such as GL_POINT_SIZE
and GL_POINT_SMOOTH control the rasterization of the points. Polygon rasterization attributes other than GL_POLYGON_MODE
have no effect.
GL_LINE Boundary edges of the polygon are drawn as line segments. They are treated as connected line segments for line stippling;
the line stipple counter and pattern are not reset between segments (see glLineStipple). Line attributes such as
GL_LINE_WIDTH and GL_LINE_SMOOTH control the rasterization of the lines. Polygon rasterization attributes other than
GL_POLYGON_MODE have no effect.
GL_FILL The interior of the polygon is filled. Polygon attributes such as GL_POLYGON_STIPPLE and GL_POLYGON_SMOOTH control the ras-
terization of the polygon.
EXAMPLES
To draw a surface with filled back-facing polygons and outlined front-facing polygons, call glPolygonMode(GL_FRONT, GL_LINE);
NOTES
Vertices are marked as boundary or nonboundary with an edge flag. Edge flags are generated internally by the GL when it decomposes poly-
gons; they can be set explicitly using glEdgeFlag.
ERRORS
GL_INVALID_ENUM is generated if either face or mode is not an accepted value.
GL_INVALID_OPERATION is generated if glPolygonMode is executed between the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGet with argument GL_POLYGON_MODE
SEE ALSO
glBegin, glEdgeFlag, glLineStipple, glLineWidth, glPointSize, glPolygonStipple
GLPOLYGONMODE(3G)