Search Results

Search: Posts Made By: Chubler_XL
83
Posted By Chubler_XL
A process calls the wait() function and kernel...
A process calls the wait() function and kernel level code checks the status of a child process, it will suspend execution of the calling thread until status information for one of the terminated...
Forum: Linux 1 Day Ago
249
Posted By Chubler_XL
What value do you have for swappiness...
What value do you have for swappiness (https://en.wikipedia.org/wiki/Paging#Swappiness):

# cat /proc/sys/vm/swappiness
60


You can try tweaking this back a lower percentage (eg add/change...
74
Posted By Chubler_XL
This looks like a homework question to me, I...
This looks like a homework question to me, I hope you were told not to try running this program on a production system.
460
Posted By Chubler_XL
You could use sed (or similar) to convert your...
You could use sed (or similar) to convert your input syntax to an awk expression eg:

CONDITIONS="(1=CT or 2=US_10) and 3=CT_US_10 and 4="
CONDITIONS=$(echo "$CONDITIONS" |
sed \
-e...
329
Posted By Chubler_XL
This forum is not a script writing service. ...
This forum is not a script writing service.

If you have a solution you have worked on that is not complete we can help you, but you must have shown some effort to solve this yourself.

Also...
473
Posted By Chubler_XL
the first < is a standard input redirection and...
the first < is a standard input redirection and causes input to the read command to come from a file.

The second part is process substitution witch takes the format of <(list). The value list...
473
Posted By Chubler_XL
This is because commands within a pipeline are...
This is because commands within a pipeline are run in subshells so the read statement is setting the variables is a subshell which has not impact on the main shell.

You can achieve what you want...
593
Posted By Chubler_XL
That looks like a good approach. You could...
That looks like a good approach.

You could get some more efficiency by not calling the date external on each input line and using bash to convert the date time to an mmddHHMMSS number for direct...
424
Posted By Chubler_XL
This function is quite well commented, it...
This function is quite well commented, it basically uses the tail command to print the last MAX_LENGTH ($2) lines of FILE ($1) these are stored in a temporary file (name generated by the mktmp...
1,305
Posted By Chubler_XL
Ensure dollar variable to be expanded is outside...
Ensure dollar variable to be expanded is outside of single quotes eg:
echo 'File not found in '"$PWD"', please re-enter'

In your script you would do:

for i in `cat file1`
do
...
895
Posted By Chubler_XL
Firstly the posted script seems to be missing...
Firstly the posted script seems to be missing single quote at the start of the awk code, and two single quotes at the end.

Also your system is reporting that nawk is not installed nawk is usually...
Forum: Solaris 12-19-2019
2,403
Posted By Chubler_XL
Discussion moved to Solaris area, you will find...
Discussion moved to Solaris area, you will find more people with the Solaris specific knowledge to answer this question here.
887
Posted By Chubler_XL
You could you an awk script like this: awk...
You could you an awk script like this:

awk -F$'\t' '
NR>1 {
H=H OFS $2
V=$3
$0=$1
$NR=V
L[NR] = $0
}
END {
print "Date_Time" H
for(i=2; i in L; i++) print L[i]
...
132
Posted By Chubler_XL
/LISTEN/ && ! /127.0.0.1/ Match lines...
/LISTEN/ && ! /127.0.0.1/
Match lines containing LISTEN and not 127.0.0.1

gsub("::", "ALL", $0)
Replace :: with ALL on entire line

if ($4 ~ ":") { RECV[$2] }
if field #4 contains : store...
132
Posted By Chubler_XL
This should be close to what you were doing. ...
This should be close to what you were doing.

netstat -an | awk '
/LISTEN/ && ! /127.0.0.1/ {
gsub("::", "ALL", $0)
if ($4 ~ ":") { RECV[$2] }
}
/ESTABLISHED/ && ($2 in RECV) {
...
1,012
Posted By Chubler_XL
Your encode should pretty much be the same...
Your encode should pretty much be the same function as your decode, just use crypt array instead of decrypt:


encode ()
{
local word=$1
while [[ $word ]] ;
do
local code
...
1,110
Posted By Chubler_XL
There are a couple of things I'm a little unhappy...
There are a couple of things I'm a little unhappy with in my proposed solution and I'd like to update to a more robust version.

Firstly if the JSON structure contains array of objects decend()...
156
Posted By Chubler_XL
Welcome to the forums. If you are not...
Welcome to the forums.

If you are not expecting the directories to already be there (eg running the script multiple times against the same input file), you could test for the existence and...
1,110
Posted By Chubler_XL
The normal practice would be to redirect to a...
The normal practice would be to redirect to a temporary file and then move the temp file over the original.

jq -c '.....' infile > /tmp/jqtemp.$$ && mv -f /tmp/jqtemp.$$ infile
1,110
Posted By Chubler_XL
After reading your request again it appears you...
After reading your request again it appears you want to identify an IP addresses in any non-array JSON data array and convert it to an array.

input :
{"adaptor" : "ip01" , "gateway" :...
1,110
Posted By Chubler_XL
It's not valid to have same key multiple times in...
It's not valid to have same key multiple times in the one record. Try running your input thru a JSON validator (https://jsonformatter.curiousconcept.com/)
830
Posted By Chubler_XL
known_hosts is for the client side ssh-copy-id...
known_hosts is for the client side ssh-copy-id will not change the servers known_hosts file


id_rsa and id_rsa.pub are generated by ssh-keygen on the server side, these would be used to another...
1,128
Posted By Chubler_XL
Welcome to the forum, firstly some housekeeping ...
Welcome to the forum, firstly some housekeeping
...
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post...
1,376
Posted By Chubler_XL
RudiC although your replace works for ~/dir/path...
RudiC although your replace works for ~/dir/path it would not work for ~root/data/mydatafile or /home/dba/data~files/myarray.dat.
The function in post #7 supplies a more accurate expansion.
1,376
Posted By Chubler_XL
The problem is ~ is not being expanded. It turns...
The problem is ~ is not being expanded. It turns out to be a little tricky to expand ~ but also avoid word separation on the path name (white spaces in you array source filename).

Try:function...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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