👤
Home Man
Search
Today's Posts
Register

Showing results 1 to 25 of 500
Search took 0.24 seconds.
Search: Posts Made By: Corona688
Forum: Programming 14 Hours Ago
Replies: 1
Views: 75
Posted By Corona688
int * isn't enough information for C to know what...

int * isn't enough information for C to know what kind of array is being pointed to. That assumes a single integer or 1D array.

int *matrix[size][size] does not make pointers to 2d arrays -- it...
Forum: Shell Programming and Scripting 5 Days Ago
Replies: 4
Views: 137
Posted By Corona688
find simply doesn't return nonzero unless...

find simply doesn't return nonzero unless something prevents it from doing what you asked it to do. If it tries to do open a directory and the system tells it "Permission denied", that's an error...
Forum: Programming 1 Week Ago
Replies: 4
Views: 180
Posted By Corona688
That it compiled without errors only means your...

That it compiled without errors only means your program is correct grammatically, the same way "my hovercraft is full of eels" will pass a grammar check but not help Belgians communicate with...
Forum: Shell Programming and Scripting 2 Weeks Ago
Replies: 1
Views: 219
Posted By Corona688
/usr/bin/ffmpeg -i ""$name"" The redundant quotes...

/usr/bin/ffmpeg -i ""$name"" The redundant quotes mean the variable's not actually quoted at all. Remove the ones marked in red.
Forum: Programming 3 Weeks Ago
Replies: 1
Views: 257
Posted By Corona688
C is the underpinnings for C++. If you do not...

C is the underpinnings for C++. If you do not understand C, your understanding of C++ will be poor. Most people skip it... and most programmers are poor.
Forum: Shell Programming and Scripting 3 Weeks Ago
Replies: 8
Views: 333
Posted By Corona688
Please use code tags. You got one bit...

Please use code tags.

You got one bit backwards, so your program ends up throwing away the first argument before you use it. Try reversing these two lines.

#!/bin/bash
echo "arg count = $#"
...
Forum: Shell Programming and Scripting 3 Weeks Ago
Replies: 4
Views: 265
Posted By Corona688
Hm. To prevent find from running too often -...

Hm. To prevent find from running too often - disk intensive to list an entire big directory tree -- how about:


DIR="/home/pc/Pictures"

while true
do
find "$DIR" -type f -name...
Forum: Programming 4 Weeks Ago
Replies: 6
Views: 494
Posted By Corona688
The risk of strcpy is this: char buf[8]; //...

The risk of strcpy is this:

char buf[8]; // Only room for 8 characters
char very_important_variable_touch_and_the_world_explodes=42;

// More than 8 characters, where does the rest go?...
Forum: Programming 4 Weeks Ago
Replies: 6
Views: 494
Posted By Corona688
Stop that! That's not how you use strncpy! And...

Stop that! That's not how you use strncpy! And also not why people use it.

Blindly using strncpy because people call strcpy "bad" is worse than just using strcpy in the first place. You are not...
Forum: Programming 07-12-2018
Replies: 6
Views: 494
Posted By Corona688
None of these do anything weird with newlines at...

None of these do anything weird with newlines at all.

Blindly using anything without knowing what it's for or what it does will cause problems, as it has here. strcpy would have worked.


...
Forum: Shell Programming and Scripting 07-12-2018
Replies: 17
Views: 343
Posted By Corona688
There are two problems with your regex. "." is a...

There are two problems with your regex. "." is a special character meaning "any single character", ergo, the regex "192.168.0.126" would also match "1912168Q0126"!

Fixing your particular problem...
Forum: Ubuntu 06-29-2018
Replies: 19
Views: 1,023
Posted By Corona688
Samba is no longer needed for as many things as...

Samba is no longer needed for as many things as it used to be. It's still the go-to to serve shares, but native client support has popped up in many operating systems. In Linux you can do

mount...
Forum: What is on Your Mind? 06-29-2018
Replies: 36
Views: 1,078
Posted By Corona688
I may be in the minority here, but I'm not sure I...

I may be in the minority here, but I'm not sure I like it - yet. It's a good idea, and the line numbering is especially helpful, but the feature needs to be thought through.

This disrupts our...
Forum: Shell Programming and Scripting 06-28-2018
Replies: 23
Views: 1,156
Posted By Corona688
GOT IT! If you want to send to nc more than...

GOT IT! If you want to send to nc more than once, you always have to do so from the same source port and IP. Otherwise nc will think you're a different sender and ignore it. And the source port is...
Forum: Shell Programming and Scripting 06-26-2018
Replies: 9
Views: 509
Posted By Corona688
As mentioned above, your MS Windows style text...

As mentioned above, your MS Windows style text file is full of carriage returns:

0000040 sp a n d sp O p e r a t o r cr nl G
6120 646e 4f20 6570 ...
Forum: UNIX for Beginners Questions & Answers 06-26-2018
Replies: 9
Views: 557
Posted By Corona688
MS Windows has three kinds of directory paths...

MS Windows has three kinds of directory paths which partly overlap and partly don't and almost no programs implement all of them.

BASH would be no help here, as in UNIX, there's only one kind of...
Forum: OS X (Apple) 06-25-2018
Replies: 2
Views: 798
Posted By Corona688
Occasionally it's useful to lie about what your...

Occasionally it's useful to lie about what your terminal is, i.e. LC_ALL="en_GB.US-ASCII" grep filename whatever to speed up grep when you know it won't matter. But changing the environment...
Forum: UNIX for Beginners Questions & Answers 06-07-2018
Replies: 5
Views: 261
Posted By Corona688
We're not going to improve "several days" into...

We're not going to improve "several days" into "instant" no matter what the means. Further, any program which creates files does largely does the same thing as cp.

Parellizing is usually a...
Forum: UNIX for Advanced & Expert Users 06-08-2018
Replies: 3
Views: 263
Posted By Corona688
Guessing you're running grep once per record, if...

Guessing you're running grep once per record, if it's taking hours. How about:

$ awk 'LFN != FILENAME { LFN = FILENAME ; FILENUM++ }
FILENUM==1 { A[$1] ; next }
FILENUM==2 { if($4 in A) ...
Forum: Programming 06-04-2018
Replies: 2
Views: 190
Posted By Corona688
this...

this (https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/) slightly longwinded article...
Forum: Solaris 06-04-2018
Replies: 11
Views: 526
Posted By Corona688
That rsync is slow while using very little CPU...

That rsync is slow while using very little CPU points to an I/O bottleneck. They're spending most of their time waiting for disk. Maybe your system ended up using a fallback driver of some sort.
Forum: Programming 05-29-2018
Replies: 7
Views: 269
Posted By Corona688
println() means "print line", it prints lines. ...

println() means "print line", it prints lines.

You could assemble the entire line you wanted to print before printing it.
Forum: Shell Programming and Scripting 05-16-2018
Replies: 8
Views: 452
Posted By Corona688
To explain the exact problem: You can't insert...

To explain the exact problem: You can't insert data into the middle of a file, just overwrite it from that point forwards. So you can't edit without completely overwriting everything after that...
Forum: Shell Programming and Scripting 05-23-2018
Replies: 23
Views: 1,156
Posted By Corona688
I wonder if it's network-related. Are the sender...

I wonder if it's network-related. Are the sender and receiver on the same subnet?
Forum: Shell Programming and Scripting 05-23-2018
Replies: 4
Views: 239
Posted By Corona688
. /etc/profile ; rest of stuff perhaps.

. /etc/profile ; rest of stuff perhaps.
Showing results 1 to 25 of 500

 


All times are GMT -4. The time now is 03:12 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password