Search Results

Search: Posts Made By: RudiC
Forum: Shell Programming and Scripting 23 Hours Ago
105
Posted By RudiC
bash doesn't handle floating point numbers, only...
bash doesn't handle floating point numbers, only integers. On top, (man bash)
You might want to consider the -gt operator.
59
Posted By RudiC
Your script seems a bit intricate. E.g. when...
Your script seems a bit intricate. E.g. when using the > redirection, you don't need to create / truncate the file upfront. And, with that many temp files, there must be a better approach. How far...
200
Posted By RudiC
Your files are NOT *nix text files - they use DOS...
Your files are NOT *nix text files - they use DOS <CR> (= ^M = 0x0D = \r) line terminators, which usually cause problems with *nix text tools:
file /tmp/file*
/tmp/file1.txt: ASCII text, with CRLF...
79
Posted By RudiC
Try the -s option. man sh: gsutil cat...
Try the -s option. man sh:

gsutil cat gs://sample-bkt/transaction_test/sample_scripts/test.sh | sh -s 12 14
200
Posted By RudiC
Pls show detailed, abbreviated but...
Pls show detailed, abbreviated but representative, samples of respective files, supported by e.g. a hexdump of each. so we stop shooting in the dark and start a data driven analysis.
133
Posted By RudiC
If you want to reduce the number of date...
If you want to reduce the number of date executions, try also (given your shell offers "process substitution", and date has the -f option):

$ DAYS=20
$ STARTDT=$(date +%s)
$ ENDDT=$((STARTDT +...
206
Posted By RudiC
Or, "Advanced search" ing for "missing" "value"...
Or, "Advanced search" ing for "missing" "value" gives


https://www.unix.com/shell-programming-and-scripting/279413-fill-missing-values.html?highlight=missing+values...
206
Posted By RudiC
On top of what RavinderSingh13 already said,...
On top of what RavinderSingh13 already said, similar problems have been solved umpteen times in these fora. Try to find (and adapt?) one or several...
5
sed
143
Posted By RudiC
Any attempts / ideas / thoughts from your side? ...
Any attempts / ideas / thoughts from your side?


Hint from man sed:
328
Posted By RudiC
You're close. How could you accomplish the other...
You're close. How could you accomplish the other half of the task?


And, pls use code tags.
328
Posted By RudiC
Any attempts / ideas / thoughts from your side?...
Any attempts / ideas / thoughts from your side? Any preferences?


Is that homework / classwork?
237
Posted By RudiC
Didn't you want "the {start time, mem_before} in...
Didn't you want "the {start time, mem_before} in one column, and {end time, mem_after} in another column" ?


Try also this slightly condensed version (that assumes there is a start time when...
237
Posted By RudiC
Try posting runnable, syntax error free code only...
Try posting runnable, syntax error free code only so people can concentrate on the logical problems. I won't comment on the obvious errors in your incomplete code snippet above. How about
awk '...
625
Posted By RudiC
Now, it doesn't break, that is. The ssh just eats...
Now, it doesn't break, that is. The ssh just eats up all stdin which is redirected from .outlist.tmp, and the while read cleanly finishes on end-of-file. Did you consider using another file...
484
Posted By RudiC
No, it's not. How do you expect people to bug...
No, it's not. How do you expect people to bug hunt if they don't see what is actually going wrong? Show the directory listing from your target system. If that is confidential, build a dummy one but...
484
Posted By RudiC
Show your actual directory structure EXPLICITLY,...
Show your actual directory structure EXPLICITLY, like
tree -d
.
├── D1
│ ├── D2
│ │ └── L1
│ ├── D3
│ │ └── L2
│ └── D4
│ ├── L1
│ ├── L2
│ └── L3
└── test...
625
Posted By RudiC
Does lshwres interact directly with the terminal?...
Does lshwres interact directly with the terminal? Are there any options to disable this? I could sort of replicate the situation with stty:
ssh -n -t user@remotehost "hostname; stty"...
484
Posted By RudiC
Pls post your (representative, full breadth)...
Pls post your (representative, full breadth) directory structure down to "folder". Which you should do anyhow, always.
484
Posted By RudiC
Come on - cding to * cannot by all means happen...
Come on - cding to * cannot by all means happen unless each * expands to exactly one directory.
625
Posted By RudiC
Your code snippet does not look like what you...
Your code snippet does not look like what you showed in post #1. Where do you get the error? Is it issued by ssh or by lshwres? Try changing -T to -t.


Split the problematic code into smaller...
301
Posted By RudiC
Added file "servers.txt" to read from.
Try
while read server
do sshpass -p 'abc' ssh -o StrictHostKeyChecking=no -q -t xyz@${server} awk -v"HN=$(hostname)" '/[mM]inimum/ {next} /PASS_MIN_LEN/{print HN, $2}' /etc/login.defs`
...
276
Posted By RudiC
Tryfind . -printf "%T@ %Tc %p\n" | sort -r | cut...
Tryfind . -printf "%T@ %Tc %p\n" | sort -r | cut -d" " -f2-
354
Posted By RudiC
The first posistional parameter is NOT an array,...
The first posistional parameter is NOT an array, and thus can't be indexed.


How about
verifyfiles() { for sym ; do echo "Array in FUNCTION Contains:"; echo "$sym"; done; }
.
.
....
276
Posted By RudiC
How far would find . -printf "%T@ %p\n" | sort...
How far would
find . -printf "%T@ %p\n" | sort -r
get you?
246
Posted By RudiC
How about echo "${1//\\\\n/$'\n'}" | awk '$5...
How about
echo "${1//\\\\n/$'\n'}" | awk '$5 {print "File is:", $5}'
File is: /app/scripts/testingscr5.scr
File is: /app/mrt/testingscr6.mrt
File is: /app/exe/testingscr9.exe
File is:...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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