Search Results

Search: Posts Made By: Corona688
3,632
Posted By Corona688
It's also important to realize that parallel can...
It's also important to realize that parallel can be a performance loss in some situations, especially if any of these queries are disk-intensive.
25,817
Posted By Corona688
<$path_to_dir tries to read from that as if it's...
<$path_to_dir tries to read from that as if it's a filename -- not as if it's a list of lines. Technically it's valid for a filename to have newlines in it, strangley enough! The only invalid...
3,888
Posted By Corona688
These files are used on login. sudo bash is not...
These files are used on login. sudo bash is not a login.

Environment variables are external memory designed to be shared. Functions are part of a shell's internals and are not. For sudo bash to...
5,384
Posted By Corona688
Well that's not going to work. You're just...
Well that's not going to work. You're just printing the statements to the screen and not giving anything to sshpass at all.

Does your script change the variable IFS? Strings are supposed to...
2,841
Posted By Corona688
Do not post classroom or homework problems in the...
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum (https://www.unix.com/homework-coursework-questions/) under special...
5,384
Posted By Corona688
I won't know the issue until it works. ...
I won't know the issue until it works. Nonprinting characters are nonprinting, invisible to copy-paste. If there were nonprinting characters in your array you might not see them. Did you try my...
5,384
Posted By Corona688
No reason * shouldn't expand, perhaps you ended...
No reason * shouldn't expand, perhaps you ended up with nonprinting characters like carriage returns in your array or some such. If the commands work when pasted, that's what I'd bet.

By the way,...
5,384
Posted By Corona688
The echo you removed was necessary. Without it,...
The echo you removed was necessary. Without it, you are attempting to run a file named "( cd /path/to/${ID}*/*/folder && exec sshpass -f file.txt scp...
10,950
Posted By Corona688
If your values will never contain spaces, you can...
If your values will never contain spaces, you can "pass" arrays as strings "val1 val2 val3" and split them back inside the function, like this:

#!/bin/ksh

set -A filelist val1 val2 val3
set -A...
1,246
Posted By Corona688
We get asked how to do date math in AIX so often...
We get asked how to do date math in AIX so often I made a perl script for it (https://www.unix.com/unix-for-beginners-questions-and-answers/239167-general-purpose-date-script.html). It's a...
2,511
Posted By Corona688
Run like: ksh script.sh...
Run like:
ksh script.sh /path/to/filename12345.txt

Inside:
#!/bin/ksh

# $1 = filename12345.txt
set -- $(echo "$1" | tr -cd '0-9')
# $1 is now 12345

# rest of program
5,384
Posted By Corona688
Show your code. Always. Show your code.
Show your code.

Always. Show your code.
5,384
Posted By Corona688
This is a rather roundabout way of sending files!...
This is a rather roundabout way of sending files! sshpass executing sshpass executing scp. Isn't there a better way?

Anyway, this doesn't do what you think. Each ID only gets used once. The...
2,511
Posted By Corona688
ksh scriptname $(cat filename)
ksh scriptname $(cat filename)
9,796
Posted By Corona688
You missed the point. set and case is a...
You missed the point. set and case is a replacement for XX=`echo "$QUERY_STRING" | sed -n 's/^.*val_x=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"`

As for "no such file or directory", I'll hazard a wild...
Forum: HP-UX 09-26-2019
8,430
Posted By Corona688
It will exit by itself once done, but you...
It will exit by itself once done, but you probably want an 'exit 0' at the end in case any of the cp commands couldn't copy.

Cron also has a useful feature where any output from the command gets...
Forum: Cybersecurity 09-26-2019
5,540
Posted By Corona688
It's an interesting example of how discredited...
It's an interesting example of how discredited programming methods get renamed to make them acceptable again.

Self-modifying code? Obviously bad and never allowed, at all, ever.
...
Forum: Cybersecurity 09-26-2019
8,275
Posted By Corona688
Difficult to follow precisely without lastb, but...
Difficult to follow precisely without lastb, but grepping 'authentication failure' in log files, one of my servers has 66,000 failed logins since Sep 22, which is awfully close to your 15,000 a day. ...
6,414
Posted By Corona688
Another way that doesn't need externals, arrays,...
Another way that doesn't need externals, arrays, loops, or backticks:

INPUT="string'delimited'with'quotes"
OLDIFS="$IFS" ; IFS="'"
printf "%s\n" $INPUT
IFS="$OLDIFS"
2,024
Posted By Corona688
I'd start with find /lib* /usr/lib* -iname...
I'd start with find /lib* /usr/lib* -iname '*qt*.so*'

Faling that, ldd some-program-that-uses-qt
89,848
Posted By Corona688
BASH allows you to use the basic TTY properties...
BASH allows you to use the basic TTY properties to establish timeouts and read minimums:

#!/bin/bash

# Timeout is 1/10 of a second, minimum read is 0 characters
stty -icanon min 0 time 1
...
6,126
Posted By Corona688
There's no point using cut inside awk. ...
There's no point using cut inside awk.

out_value=substr($1,9,3)

...but for the record you could use backticks, variable=`command`; ...at a very large performance cost.
58,800
Posted By Corona688
I think access time includes reads too, if its...
I think access time includes reads too, if its enabled. But its been so long since I've seen a system that had atimes enabled, I'm not 100% positive.

Unless you know for a fact atimes are enabled...
3,474
Posted By Corona688
For that matter, there's already return values...
For that matter, there's already return values here you aren't checking.

function2()
{
cat test.txt # If this fails, $? will be nonzero
}

if ! function2
then
echo "Could...
Forum: Programming 08-09-2019
15,169
Posted By Corona688
"Dying" is hyperbole. By that metric I'm sure...
"Dying" is hyperbole. By that metric I'm sure awk has been dead for half a century. It still persists where its feature set is useful, as does Perl.

One thing that makes Perl especially useful...
Showing results 1 to 25 of 500

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