Search Results

Search: Posts Made By: RudiC
200
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.
Forum: Shell Programming and Scripting 2 Hours Ago
94
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...
130
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`
...
146
Posted By RudiC
Tryfind . -printf "%T@ %Tc %p\n" | sort -r | cut...
Tryfind . -printf "%T@ %Tc %p\n" | sort -r | cut -d" " -f2-
190
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; }
.
.
....
146
Posted By RudiC
How far would find . -printf "%T@ %p\n" | sort...
How far would
find . -printf "%T@ %p\n" | sort -r
get you?
120
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:...
269
Posted By RudiC
Try also (your code simplified): awk...
Try also (your code simplified):
awk 'length==80 {ORS=""} 1; {ORS=RS}' fileor
awk '{ORS=length==80?"":RS} 1' file

Your first attempt doesn't work as expected as ORS is never reset to RS, as...
188
Posted By RudiC
How about printf "Match Found for File: %s\n"...
How about
printf "Match Found for File: %s\n" /app/scripts/*$1*
214
Posted By RudiC
Or provide a default value in case harr[$j] is...
Or provide a default value in case harr[$j] is empty / unset:
if [ ${harr1[$j]:-1} -eq $search ]
then break
fi
341
Posted By RudiC
Shells don't expand variables within single...
Shells don't expand variables within single quotes.
250
Posted By RudiC
Any attempts / ideas / thoughts from your side? ...
Any attempts / ideas / thoughts from your side?
Your OS and shell?
308
Posted By RudiC
Given your uniq provides all the options shown,...
Given your uniq provides all the options shown, try
sort -k4,4 file | uniq -D -f3 -w5
40993876 4531 724 10154 Strep A
40993878 4533 724 10154 Strep B
40991764 2419 ...
259
Posted By RudiC
Yes, in your above example it will print alpha...
Yes, in your above example it will print alpha and beta, but in general, it will print the before-last field.
259
Posted By RudiC
It's the same as $NF - the last field in the...
It's the same as $NF - the last field in the input line regardless of its actual field number.
awk splits the line into n fields and then assigns n to NF (number of fields?) If you have three...
289
Posted By RudiC
As the number of / may vary with path depth, or...
As the number of / may vary with path depth, or with the locale date format, it might be safer to extract the relevant field first from that comma delimited file:
cut -d ',' -f 30 file
...
272
Posted By RudiC
In case there are other occurrences of three...
In case there are other occurrences of three letters followed by a space and a digit, you might want to narrow down the search pattern to the locale months:
sed -r "s/($(locale abmon | tr ';' '|'))...
933
Posted By RudiC
Thanks, MadeInGermany, for pointing that ssh -n...
Thanks, MadeInGermany, for pointing that ssh -n option out. Still, the commands are passed as such (no backtics ``!) to the remote server, so uname -r will be executed remotely.


The script was...
118
Posted By RudiC
Double post?...
Double post? https://www.unix.com/303039567-post8.html
393
Posted By RudiC
Is it possible to e.g. sort -t, -k2,2 -k4r...
Is it possible to e.g.

sort -t, -k2,2 -k4r -k3 file
393
Posted By RudiC
Will the data follow a certain sequence, i.e....
Will the data follow a certain sequence, i.e. parent dirs sorted, parent dir before child dir, non-empty $3 before empty $3, non-empty $4 before empty $4?
393
Posted By RudiC
Why does ...
Why does

level1,/level2/level3/level4/ora003,4,IBB25
show up in file2?
117
Posted By RudiC
How about awk '{sub ($1 ",", "", $2)} 1' file ...
How about
awk '{sub ($1 ",", "", $2)} 1' file
5_2207830114 13_2207830312,15_2207830336
8_2207830145 15_2207830336
10_2207830220...
393
Posted By RudiC
What about your own approach to solve the problem?
What about your own approach to solve the problem?
393
Posted By RudiC
Any attempt / idea / thought from your side? ...
Any attempt / idea / thought from your side?


I can't see your logics example comply to your specification - none of those $2 values represent the "same path upto 5 dir levels". The first entry...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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