Search Results

Search: Posts Made By: Juha Nurmela
1,574
Posted By Juha Nurmela
Nice problem. Coordinates :) read, a shell...
Nice problem. Coordinates :)

read, a shell builtin, is not the bottleneck, I think. You are launching a lot of processes and the data is large.

Would you benefit from cutting down on the data...
2,538
Posted By Juha Nurmela
Check those double quotes, you have to escape the...
Check those double quotes, you have to escape the inner ones. As it stands now, it executes parts of the command locally.

Juha
2,403
Posted By Juha Nurmela
The script snippet looks garbled. It sounds like...
The script snippet looks garbled. It sounds like the wildcard in the pattern got expanded by the shell at some point. You need more double quotes where it happens :)

But aren't you making it too...
817
Posted By Juha Nurmela
Try walking the array manually for (j = 0; j <...
Try walking the array manually
for (j = 0; j < y; ++j)
print a[j]

Juha
5,921
Posted By Juha Nurmela
You might consider creating your own dedicated...
You might consider creating your own dedicated directory for the script in question (and those that will follow :). Put that directory in your path, not the ".".

Juha
1,710
Posted By Juha Nurmela
echo some_input | command <<HERE but_so_is_this...
echo some_input | command <<HERE
but_so_is_this
HERE

Get it? Move the second input to the here-doc also.
Juha
1,582
Posted By Juha Nurmela
logger -h host -P port. Have these options...
logger -h host -P port. Have these options existed always ?

Juha
4,382
Posted By Juha Nurmela
It would be worth a new thread, how to tidy up...
It would be worth a new thread, how to tidy up filenames after unpacking an archive with funny characters. Everyone probably has their own quick fix :)

Juha
4,382
Posted By Juha Nurmela
Beware, it likes to resize the field widths when...
Beware, it likes to resize the field widths when there are large files.

Juha
3,358
Posted By Juha Nurmela
Your inner script looks kind of funny: you start...
Your inner script looks kind of funny: you start a command, and wait for it to end. Maybe you have your reasons, but wouldn't
if hive ... # (without &)
then
echo Success
exit 0
fi...
1,438
Posted By Juha Nurmela
I didn't, it's $ time btpick audio_. audio_1...
I didn't, it's
$ time btpick audio_.
audio_1
0.01s real 0.00s user 0.00s system as-is

---------- Post updated at 01:25 AM ---------- Previous update was at 01:24 AM ----------
...
1,438
Posted By Juha Nurmela
Nice catch. If there's a problem, the error...
Nice catch. If there's a problem, the error message would be blocked, thanks.

---------- Post updated at 01:20 AM ---------- Previous update was at 01:19 AM ----------

sed has the quit on first...
1,438
Posted By Juha Nurmela
They write to the pipe, no? Doing the...
They write to the pipe, no?

Doing the explicit sleep actually works really snappy. Immediate response!
Argument has to be -fc1, else the program makes an extra sleep after each ping.
1,438
Posted By Juha Nurmela
Yes, that's just what I was after, to run the...
Yes, that's just what I was after, to run the pings inside a pty, so that they would choose line-buffering.

---------- Post updated at 01:02 AM ---------- Previous update was at 12:57 AM...
1,438
Posted By Juha Nurmela
I had a peek into the expect, and it does look...
I had a peek into the expect, and it does look like there would a mechanism to run the children in a pty, to seduce line-buffering. Very long manpage though.

Juha
4,224
Posted By Juha Nurmela
If you have an aversion to perl, and one-liner is...
If you have an aversion to perl, and one-liner is a must, try sed -f command_file and put
s/A/65/
s/B/66/
etc
into the command_file.

Juha :)
1,438
Posted By Juha Nurmela
Getting piped input from a program that's buffering it's stdout
The old buffering problem again, in a very specific case. On FreeBSD this time, but it's the generic line-buffered vs fully-buffered problem.

I'm trying to pick an available bluetooth speaker (all...
1,079
Posted By Juha Nurmela
How about ssh host "commands" | tr ' ' ' 'Or,...
How about
ssh host "commands" | tr '
' ' 'Or, move the tr to run in the server, if electricity is cheaper there :)
Juha

Meh, I'm an idiot, same as rbatte1's post.
1,482
Posted By Juha Nurmela
split -p could be an option, if you can live with...
split -p could be an option, if you can live with how it distributes the pattern lines. And if your split has the -p option.

Juha

Sorry about the missing tags.
1,469
Posted By Juha Nurmela
kill -0 is often convenient, if checking when it...
kill -0 is often convenient, if checking when it went away. Works just as normal signals do, but does not
have any effect in the receiving process.

Juha

Can anyone condense it, having the KILL...
Forum: Programming 09-30-2016
3,711
Posted By Juha Nurmela
If you can find a suitable scanf-format, you...
If you can find a suitable scanf-format, you might be able to do it all with one fscanf. If you have to change things later, this could be useful, or not. Probably not, but you are the judge.
...
4,186
Posted By Juha Nurmela
Third might be $ content='echo $aa' $...
Third might be
$ content='echo $aa'
$ aa=hep
$ eval $content
hep
$ Juha

But an exit within content probably breaks things
8,369
Posted By Juha Nurmela
Surely the shell also uses those system calls. ...
Surely the shell also uses those system calls.

There are oddities in file locking, see the manpages if you care. One oddity is that if you open a file, lock it, open it again and close that latter...
8,369
Posted By Juha Nurmela
I think the _exit(2) of the shell is sufficient,...
I think the _exit(2) of the shell is sufficient, no need to explicitly unlock.

However... will you ever leave background processes ? The descriptor would be passed to them, and, depending on the...
Forum: Programming 09-05-2016
4,324
Posted By Juha Nurmela
Okay, I was assuming too much. Juha
Okay, I was assuming too much.

Juha
Showing results 1 to 25 of 27

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