Search Results

Search: Posts Made By: spirtle
5,203
Posted By spirtle
TonyFullerMalv's solution is more general, but if...
TonyFullerMalv's solution is more general, but if all the log files are in the same directory, then

grep -l "ERROR:" /output/*.log

is all you need.
2,747
Posted By spirtle
devtakh's solution tells you if the file has less...
devtakh's solution tells you if the file has less than three lines. Maybe this is all you need and I have misunderstood the situation, but I would use grep(1) to check for the occurrence each...
Forum: Programming 06-05-2009
2,802
Posted By spirtle
For documentation you might look at (Doxygen...
For documentation you might look at (Doxygen (http://doxygen.org)) which generates HTML from specailly formatted comments in source code and is flexible enough to be tweaked in all sorts of ways to...
4,772
Posted By spirtle
cfajohnson is right! You can even do it with...
cfajohnson is right! You can even do it with tcsh:

set filename = file_name.xyz
echo $filename:e
8,753
Posted By spirtle
By default, curl writes to standard output, so to...
By default, curl writes to standard output, so to get it to write to a file you can either use the usual Unix file redirection

curl url > file

or use the -o or --output option

curl url -o...
3,611
Posted By spirtle
Since you are using Perl and I don't know much...
Since you are using Perl and I don't know much sed, here's some perl to extract the description.
I guess your biggest problem will be identifying where the description ends. In the following I have...
2,307
Posted By spirtle
You need a space between the '@' and the...
You need a space between the '@' and the variable. Try

@ x=1
while ($x <=$number)
echo $x
@ x += 2
end
27,661
Posted By spirtle
The problem is that the -e test expects just one...
The problem is that the -e test expects just one file name, so it breaks if your pattern matches several files. Do the test on just one file, i.e. the first element of $filetype:

if ( -e...
Forum: Programming 02-06-2009
3,632
Posted By spirtle
You need to think about what the chain of...
You need to think about what the chain of dependencies really are:

The executable Code1 depends on the object files Code1.o and Tools.o
The object file Code1.o depends on the source files...
Forum: Programming 01-15-2009
1,728
Posted By spirtle
This line is dodgy: ...
This line is dodgy:

data[0].friends=malloc(2*sizeof(struct record));

record::friends is of type pointer to pointer to struct record, but you are allocating space for two structs, which isn't...
5,211
Posted By spirtle
The "strict" pragma makes it an error to use...
The "strict" pragma makes it an error to use various potentially unsafe or confusing code constructs. Type man 3 strict to find out which ones. Unless you have a very good reason for using such...
3,192
Posted By spirtle
vgersh99's solution also removes lines with no...
vgersh99's solution also removes lines with no "happy" string, so be careful.
I think

grep -v "happy.*happy" oldfile > newfile

is simpler, or equivalently

grep -v "\(happy.*\)\{2\}"...
4,427
Posted By spirtle
It's not clear to me what the problem is, but you...
It's not clear to me what the problem is, but you should probably change to each directory and run Latex from there. That way, the .aux file will not be overwritten (which could be important if you...
Forum: Programming 01-06-2009
11,477
Posted By spirtle
I prefer the second form because: The...
I prefer the second form because:

The interface is simpler: one parameter in, the answer returned. You just check whether the pointer is null to verify success. The first form has some kind of...
Forum: UNIX and Linux Applications 12-23-2008
9,547
Posted By spirtle
You can make a start with :set autoindent or ...
You can make a start with
:set autoindent
or
:set cindent
and
:set shiftwidth=4
which sets the number of spaces to indent by.
You can then do all manner of C-specific fine-tuning by setting...
Forum: Programming 12-22-2008
3,561
Posted By spirtle
The devil is often in the details, so please be...
The devil is often in the details, so please be explicit about how you are doing this.
Also, since life is a pointer to pointer to struct life,

then attempting to get a nolife member from it...
4,260
Posted By spirtle
Does this work for you? perl -pe...
Does this work for you?

perl -pe 's/(\S)""/$1"/g; s/""(\S)/"$1/g' file

This just replaces with a " any "" that is not adjacent to a space.
Forum: Linux 12-17-2008
15,462
Posted By spirtle
I think this would be better placed in the High...
I think this would be better placed in the High Level Programming - The UNIX and Linux Forums (https://www.unix.com/high-level-programming/) forum.

I assume
PROGRAM = test2.c
should be...
Forum: What is on Your Mind? 12-17-2008
17,259
Posted By spirtle
I usually take a look around in the morning (GMT)...
I usually take a look around in the morning (GMT) and the total time depends on whether any questions pique my interest and how much real work I have to do.
3,317
Posted By spirtle
otool is the OSX equivalent of Linux's ldd, with...
otool is the OSX equivalent of Linux's ldd, with which you can query a binary file to see which dynamic libraries it depends on. As otheus points out, probably quite a lot will depend on libobjc.
...
Forum: What is on Your Mind? 12-12-2008
8,872
Posted By spirtle
http://www.world66.com/myworld66/visitedCountries/...
http://www.world66.com/myworld66/visitedCountries/worldmap?visited=CAUSATBECZDKFRDEHUIEITNLPLSKESCHUKVA
I like the way I get all of Canada from just having spent a long weekend in Toronto -- that's...
Forum: Programming 12-12-2008
7,178
Posted By spirtle
While there's nothing wrong with jim's answer,...
While there's nothing wrong with jim's answer, and at the risk of confusing the issue, there are alternatives:

In C, I usually prefer the strtol function because it allows checking for errors.
...
Forum: Programming 12-11-2008
5,004
Posted By spirtle
With GNU make you can use a "simply expanded"...
With GNU make you can use a "simply expanded" variable, e.g.

PCFLAGS := SQLCHECK=SEMANTICS $(PCFLAGS)

to prepend a string to a variable, or

PCFLAGS += SQLCHECK=SEMANTICS

to append it.
22,136
Posted By spirtle
What happens if you use Perl's built-in chdir...
What happens if you use Perl's built-in chdir function?
See https://www.unix.com/shell-programming-scripting/22737-how-change-working-directories-perl.html
5,577
Posted By spirtle
It's just the arguments to your aliased command....
It's just the arguments to your aliased command. i.e.
cd asdf
is expanded to
chdir asdf && setprompt

However, I don't believe those aliases are at all necessary to set your prompt. All you...
Showing results 1 to 25 of 145

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