Forum: Shell Scripting 14 Days Ago |
| Replies: 4 Views: 334 stat might give you what you want. |
Forum: C 17 Days Ago |
| Replies: 5 Views: 360 scanf("%f", &length);
length is an int, you are passing a float. Same with scanf("%f", &breadth);
Either you change the type in the declaration of length and breadth, or change the f to d in the... |
Forum: Shell Scripting 20 Days Ago |
| Replies: 14 Views: 873 If you want to continue using awk as the workhorse, then:
ls -l f3.sh | awk '{ if( NF > 7 ) { split($7, a, ":"); print a[1] } }' |
Forum: Shell Scripting 21 Days Ago |
| Replies: 14 Views: 873 As you have been shown you can pipe the ls command to another program that further parses the output, in this case awk.
awk can do a lot of things, but even in its simplest form it can be very... |
Forum: Shell Scripting 22 Days Ago |
| Replies: 14 Views: 873 Look into the command touch |
Forum: Shell Scripting 22 Days Ago |
| Replies: 11 Views: 959 if ( ${cnt} -ge "1" ) That reads if cnt is greater or equal to 1 therefore != would have not worked.
if ($cnt >= 1) then
# whatever you want to mail
endif |
Forum: Shell Scripting 23 Days Ago |
| Replies: 11 Views: 959 csh doesn't use if/fi but rather if/endif. Look at posted script and you'll see you have an if/fi.
BTW csh doesn't have the same conditional operators than bash so -ge doesn't work. |
Forum: Shell Scripting 27 Days Ago |
| Replies: 11 Views: 959 Post your code the way you wrote it to execute. Make sure there's a space between [ and ] |
Forum: Shell Scripting 27 Days Ago |
| Replies: 5 Views: 603 It makes a difference the quotation scheme.
sed "/$npname.*in/d" parts.txt > parts.tmp |
Forum: C 34 Days Ago |
| Replies: 10 Views: 568 if( line == pattern)
That's a no-no, since line and pattern are strings and you can't compare arrays in that way.
Take a look at the string function strcmp() for that.
However, even if that would... |
Forum: C 34 Days Ago |
| Replies: 6 Views: 376 The controlling expression of a switch shall have integer type.
An array of chars will not do. |
Forum: C Oct 25th, 2009 |
| Replies: 6 Views: 225 Do you know how to open a file and read from it? |
Forum: C Oct 25th, 2009 |
| Replies: 6 Views: 225 One step at a time.
Start learning how to assign values to arrays.
Learn how to read a single or group of characters from a file.
After that it is just a matter of parsing what's read and... |
Forum: C Oct 13th, 2009 |
| Replies: 16 Views: 347 Plenty of thing are erroneous in your snippet, however I would like to point out the cause of your affliction for now.
printf(" A - Addition\n S - Subtraction\n M - Multiplication\n D - Division\n Q... |
Forum: C Oct 12th, 2009 |
| Replies: 28 Views: 1,635 Funny, I thought that was part of the requirement. |
Forum: C Oct 12th, 2009 |
| Replies: 28 Views: 1,635 Perhaps another approach?
#include <stdio.h>
#include <ctype.h>
void clean_spaces(void);
int main(void)
{
clean_spaces();
return 0;
} |
Forum: C Sep 21st, 2009 |
| Replies: 7 Views: 451 Here's an assignment. Search why gets(s[i]); is a no no.
What is it that you are sorting the names by? |
Forum: Viruses, Spyware and other Nasties Sep 14th, 2009 |
| Replies: 16 Views: 1,011 SKYNET is used as part of rootkit technology which will be hard to clean unless you understand what's going on.
Maybe this thread (http://www.malwarebytes.org/forums/index.php?showtopic=12709) will... |
Forum: C Sep 7th, 2009 |
| Replies: 9 Views: 415 priyairani00> "program to swap two no. using third variable" |
Forum: C Sep 7th, 2009 |
| Replies: 9 Views: 415 |
Forum: C Aug 23rd, 2009 |
| Replies: 6 Views: 462 EvilOrange> <--Line 27 - proving the scanf("%s", &tmpfilename) is working
Dealing with the format %s in scanf() you must pass the argument as plain tmpfilename or as &tmpfilename[0], but not as... |
Forum: C Aug 23rd, 2009 |
| Replies: 6 Views: 462 On the phone
Nick: Doctor, can you cure my cough? It is a horrible cough, I cannot sleep at night.
Dr. Hell: Sorry, Nick, I cannot prescribe the proper medication without seeing you first, make an... |
Forum: Geeks' Lounge Aug 4th, 2009 |
| Replies: 4 Views: 421 PetuniaRose> Is there any chance that if and when you have the time, you could tell me how
Copy and paste. |
Forum: Geeks' Lounge Aug 4th, 2009 |
| Replies: 4 Views: 421 I use that form in conversations when I need to bring focus to a particular portion of the quote. And I use the name from origin so people don't have to follow the linear sequence of the... |
Forum: C Aug 4th, 2009 |
| Replies: 15 Views: 893 no1zson> can somebody look at my IF loop (the first one for selcting 1-3) and see where I am going wrong?
I am sure we can guess what you are trying to do, but don't you think it would be more... |
Forum: C Aug 2nd, 2009 |
| Replies: 34 Views: 1,240 yellowSnow> If this is the case, then perhaps you should try using the strtok() function.
strtok() is a poor designed function, which make this recommendation a poor choice. |
Forum: C Aug 2nd, 2009 |
| Replies: 5 Views: 376 EvilOrange> string[j][0] = string; <-- HERE IS THE PROBLEM
string[j][0] is a space to hold a character
string, on the other hand, is an array of characters. For sure there's going to be a problem... |
Forum: C Jul 9th, 2009 |
| Replies: 16 Views: 877 nonadoes> Only need to extract the number after "_C", "_V", "_S" & "_M"
Search for character _ and when you find it skip one more and that's the number you want. |
Forum: C Jul 8th, 2009 |
| Replies: 16 Views: 877 sscanf() returns EOF if it fails or the number of items that has been successfully read. By using an if statement a minimum of checking has been accommodated. It is imperative to check the return of... |
Forum: C Jun 3rd, 2009 |
| Replies: 7 Views: 311 You are mistaken.
int printf ( const char * format, ... ); is the prototype. You passed it the proper argument. |
Forum: Windows NT / 2000 / XP May 31st, 2009 |
| Replies: 9 Views: 361 bugtussellmom> I'm guessing there is some way to destroy them so the data can't be read?
A cheap and easy way of producing satisfactory results, destroying hard drives, is to drill a couple holes... |
Forum: C May 31st, 2009 |
| Replies: 5 Views: 531 file_name is a pointer already to the first character of the array.
You must omit the & or do it as &file_name[0]
The garbage output probably happens because the string is not terminated with a... |
Forum: Windows NT / 2000 / XP May 31st, 2009 |
| Replies: 9 Views: 361 For your Dell you need to use the "Reinstallation CD". That would partition your hard drive the way it came first from Dell, and it will install the Operating System it came with the Computer.
... |
Forum: Shell Scripting May 27th, 2009 |
| Replies: 4 Views: 1,097 blackrobe> Can you please give me an example on how to use the "sed" command in this case??...
I can do better than that, I will give you a link to an easy to understand tutorial... |
Forum: C May 21st, 2009 |
| Replies: 15 Views: 1,217 sanushks> Thanks! atoi works...
Do you know what happens if atoi fails to convert?
Your first choice of using sprintf was superior, since error checking is better with it. |
Forum: Geeks' Lounge May 19th, 2009 |
| Replies: 32 Views: 2,168 serkan sendur> you live in USA-welfare country.
It used to be called The Land of Opportunity.
Now, it is more like the camel in the desert, that must survive out of whatever is in the hump. Hoping... |
Forum: C May 15th, 2009 |
| Replies: 7 Views: 300 lolguy> the removing of the character outside it whish should increment the j to 3 whish should remove E
You are confused. printf("%d",j); is not the subscript used to delete the matched... |
Forum: Geeks' Lounge May 13th, 2009 |
| Replies: 32 Views: 2,168 serkan> and i wont feel like foreigner each time i am asked what my name is. it always reminds me that i am a foreigner and causes some sort of alienation.
In a more sober note, I hate to tell you... |
Forum: Geeks' Lounge May 13th, 2009 |
| Replies: 32 Views: 2,168 |
Forum: C May 3rd, 2009 |
| Replies: 2 Views: 772 >Apparently the return value from gets() differs in some way from the return value of fgets() -- enough to break the code as I've written it.
fgets() reads and include the enter key to the string,... |