Search Results

Search: Posts Made By: haritha.gorijav
6,792
Posted By Franklin52
This is Useless Use of Cat...
This is Useless Use of Cat (http://partmaps.org/era/unix/award.html).
6,792
Posted By RobP
count=`cat some_file|wc -l` echo $count
count=`cat some_file|wc -l`
echo $count
6,792
Posted By Scrutinizer
As Skrynesaver said it is spacing: count=$(wc...
As Skrynesaver said it is spacing:
count=$(wc -l < file) :D

--
There are several methods of determining the number of lines in a file, another one for example:sed -n $= file
But wc -l is by far...
6,792
Posted By pankaj_tarale
Counting lines by Awk
awk 'END { print NR }' file
6,792
Posted By Franklin52
count=$(wc - l < file)
count=$(wc - l < file)
6,792
Posted By Skrynesaver
Spacing #!/bin/bash count=$(wc -l "some...
Spacing

#!/bin/bash
count=$(wc -l "some file.txt" | cut -d\ -f1)
echo $count
37,124
Posted By Neo
Featured Books and Articles by Active Forum Members
The UNIX and Linux Forums have a number of active members that have published books or papers related to shell programming and scripting. You can check out their publications here:

Link Removed
...
Forum: Programming 03-26-2011
3,692
Posted By Corona688
And nowhere is this more true than Borland Turbo...
And nowhere is this more true than Borland Turbo C++, which has several kinds of pointers, of differing sizes, due to 16-bit segment weirdness.
Forum: Programming 03-26-2011
3,692
Posted By achenle
Arrgh! No! Not that! ;) Seriously, in order...
Arrgh! No! Not that! ;)

Seriously, in order to be perfectly clear: while a pointer may be an integer-type value, a pointer is NOT an int, nor a long, nor an unsigned int or unsigned long. A...
Forum: Programming 03-25-2011
3,692
Posted By Corona688
Adding -Wall to gcc's commandline can cause it to...
Adding -Wall to gcc's commandline can cause it to warn you about a lot of them too.
Forum: Programming 03-25-2011
3,692
Posted By drl
Hi. Sometimes lint-like tools can catch...
Hi.

Sometimes lint-like tools can catch these errors. For example, on Debian GNU/Linux, there is a utility splint. The output from running it on your code is:
% splint t1.c
Splint 3.1.2 --- 23...
Forum: Programming 03-25-2011
3,692
Posted By Corona688
char *buf; This doesn't create memory for you. ...
char *buf; This doesn't create memory for you. All a pointer is is an integer describing where memory is. And just like an uninitialized integer, an uninitialized pointer can be anything at all. ...
Showing results 1 to 12 of 12

 
All times are GMT -4. The time now is 06:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy