Search Results

Search: Posts Made By: RudiC
Forum: Shell Programming and Scripting 9 Hours Ago
57
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
101
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 +...
181
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...
215
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 '...
458
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...
458
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...
458
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.
603
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...
458
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.
262
Posted By RudiC
Tryfind . -printf "%T@ %Tc %p\n" | sort -r | cut...
Tryfind . -printf "%T@ %Tc %p\n" | sort -r | cut -d" " -f2-
262
Posted By RudiC
How far would find . -printf "%T@ %p\n" | sort...
How far would
find . -printf "%T@ %p\n" | sort -r
get you?
Forum: HP-UX 03-05-2018
2,089
Posted By RudiC
Two generic (non- HP-UX- specific) comments: -...
Two generic (non- HP-UX- specific) comments:
- why the -exec ls -l action for find? You want file names, not a "long listing". Try dropping entirely.
- Does emoaigin have write access to /root -...
386
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...
477
Posted By RudiC
Shells don't expand variables within single...
Shells don't expand variables within single quotes.
427
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 ...
369
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...
527
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
120
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...
171
Posted By RudiC
Help me out: what does {NF--NF} do in your second...
Help me out: what does {NF--NF} do in your second awk script do? An uncommon construct, at least to me...

For your problem, how about
awk -F"\t" '
NR > 2 &&
($5-$4) > 200 &&
$3...
3,720
Posted By RudiC
This highly depends on your nslookup's output....
This highly depends on your nslookup's output. With mine, this works:awk '{print $3; print $5}' file | nslookup | awk '/[Nn]ame/ {print $NF} /can.t/ {print "NA"}'
635
Posted By RudiC
Please check your arithmetics for the SUM of...
Please check your arithmetics for the SUM of pat9.
I can't see where you comply with the specified weight of .25.


Tryawk -F, -vOFS=, '
NR == 1 {
$1 = sprintf ("%-25s", $1)
...
559
Posted By RudiC
The logics are OK, but the syntax is not: - and...
The logics are OK, but the syntax is not:
- and is not a shell keyword; try -a (although deprecated)

- FILE_SIZE will not be expanded; use with $ sign

- > is being interpreted as an output...
Forum: Shell Programming and Scripting 3 Weeks Ago
197
Posted By RudiC
Try (untested)awk -F";" 'match ($0, /cov[...
Try (untested)awk -F";" 'match ($0, /cov[ ".0-9]*;/) {split (substr ($0, RSTART, RLENGTH), T, "\""); if (T[2] <= 3) next} 1' file
Forum: Shell Programming and Scripting 3 Weeks Ago
715
Posted By RudiC
Why not simplyinstalldir=${1//\\\\n/ }?
Why not simplyinstalldir=${1//\\\\n/ }?
755
Posted By RudiC
How far would sed 's#/#/bck1/#' file get you?
How far would
sed 's#/#/bck1/#' file
get you?
Showing results 1 to 25 of 500

 

Featured Tech Videos

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