Unix/Linux Go Back    

Showing results 1 to 25 of 500
Search took 0.12 seconds.
Search: Posts Made By: RudiC
Forum: UNIX for Advanced & Expert Users Linux 14 Hours Ago
Replies: 2
Views: 108
Posted By RudiC
I'm afraid you won't be able to do it without...

I'm afraid you won't be able to do it without changing the script. Yes, you can trap e.g. the SIGTERM signal and exit gracefully, but you need to make sure you intercept all ramifications.
Forum: Shell Programming and Scripting Linux 22 Hours Ago
Replies: 2
Views: 208
Posted By RudiC
You'll need to convertall times to...

You'll need to convertall times to (arithmetically) comparable numbers or strings, either epoch seconds, or e.g. "YYYYmmddHHMM" format.
Forum: Shell Programming and Scripting Linux 1 Day Ago
Replies: 1
Views: 273
Posted By RudiC
Convert either to epoch seconds and subtract...

Convert either to epoch seconds and subtract those.
Forum: UNIX for Beginners Questions & Answers Linux 1 Day Ago
Replies: 2
Views: 197
Posted By RudiC
How about awk ' {BUF = BUF...

How about
awk '
{BUF = BUF ORS $0
}
$2 == "BVX" {PRT = 1
}
/^ *\*/ {if (PRT) print BUF
BUF = $0
...
Forum: Shell Programming and Scripting Linux 1 Day Ago
Replies: 4
Views: 293
Posted By RudiC
https://www.unix.com/images/editor/separator.gifI'...

https://www.unix.com/images/editor/separator.gifI'm afraid I missed the leading counter. Try
awk '
NR > 1 {if (!(a[$3,$4])) {if (a[$4,$3]) {X = $4
...
Forum: Shell Programming and Scripting Linux 2 Days Ago
Replies: 4
Views: 293
Posted By RudiC
Try awk ' {if (!(a[$3,$4])) {if...

Try
awk '
{if (!(a[$3,$4])) {if (a[$4,$3]) {X = $4
$4 = $3
$3 = X
...
Forum: UNIX for Beginners Questions & Answers Linux 2 Days Ago
Replies: 3
Views: 131
Posted By RudiC
Use this if differences in parameter_2 and...

Use this if differences in parameter_2 and parameter_3 are to be ignored:
awk '!a[$1,$2]++' FS="\n" RS= ORS="\n\n" file
Forum: UNIX for Beginners Questions & Answers Linux 2 Days Ago
Replies: 15
Views: 342
Posted By RudiC
I'm not sure I can follow. And it doesn't seem...

I'm not sure I can follow. And it doesn't seem you want / need my awk proposal. Please answer Don Cragun's questions to their entirety.
Forum: UNIX for Beginners Questions & Answers Linux 3 Days Ago
Replies: 15
Views: 342
Posted By RudiC
The "file" represents the input file; replace by...

The "file" represents the input file; replace by your file name.
We have a boolean expression here, evaluating the char at pos 75, the result is 0 for FALSE and 1 for TRUE, which in turn is used as...
Forum: Shell Programming and Scripting Linux 3 Days Ago
Replies: 10
Views: 499
Posted By RudiC
I don't know. This is very obscure. Where does...

I don't know. This is very obscure. Where does the problem occur, in your cygwin environment?
You may have incompatibility problems between informatica and windows and cygwin, and I'm afraid I can't...
Forum: Shell Programming and Scripting Linux 3 Days Ago
Replies: 6
Views: 356
Posted By RudiC
How about if awk '{exit !(/TRX...

How about

if awk '{exit !(/TRX #\tTYPE\tREF #/)}' $file_name
then # process file
else exit 1
fiWhat's the difference between $name and $file_name?
Forum: UNIX for Beginners Questions & Answers Linux 3 Days Ago
Replies: 15
Views: 342
Posted By RudiC
Try also awk ' BEGIN {OFN[0] =...

Try also

awk '
BEGIN {OFN[0] = "temp_file"
OFN[1] = "abc_reject_pqr_a_1_yymmdd"
}

{print > OFN[substr($0,75,1)=="R"]
}
' file
Forum: Shell Programming and Scripting Linux 3 Days Ago
Replies: 6
Views: 356
Posted By RudiC
Welcome to the forum. Any attempts /...

Welcome to the forum.


Any attempts / ideas / thoughts from your side?
Forum: UNIX for Beginners Questions & Answers Linux 3 Days Ago
Replies: 15
Views: 342
Posted By RudiC
Try awk ' substr($0, 75, 1)=="R" {print $0 >...

Try
awk '
substr($0, 75, 1)=="R" {print $0 > "has_r.rxt"
next
}
1
' infilename > has_no_r.txt
Forum: Shell Programming and Scripting Linux 4 Days Ago
Replies: 10
Views: 499
Posted By RudiC
What be the OS and shell versions? Are you on a...

What be the OS and shell versions? Are you on a *nix system at all? If yes, the locale command will output your settings.
There seem to be a few non-ASCII characters in your file (as expected, BTW)....
Forum: Shell Programming and Scripting Linux 6 Days Ago
Replies: 10
Views: 499
Posted By RudiC
What encoding / character set do you use? What...

What encoding / character set do you use? What locale? Are your (text) tools multibyte encoding capable?
Forum: UNIX for Beginners Questions & Answers Linux 6 Days Ago
Replies: 4
Views: 185
Posted By RudiC
"still doesn't work" is NOT something that people...

"still doesn't work" is NOT something that people trying to help can build on, and thus doesn't answer my first question. And, don't switch topic / code / targets between posts - first you wanted to...
Forum: UNIX for Beginners Questions & Answers Linux 6 Days Ago
Replies: 4
Views: 185
Posted By RudiC
Not too clear. What exactly goes wrong? ...

Not too clear. What exactly goes wrong?


Why the for loop for a single $1 parameter without wild cards? Why the removal of today's and older files when you want 6+ days? Why the /* appended to...
Forum: Shell Programming and Scripting Linux 6 Days Ago
Replies: 7
Views: 299
Posted By RudiC
If necessary, you can adapt above to your locale...

If necessary, you can adapt above to your locale settings:

awk '
BEGIN {"locale mon" | getline TMP
for (i=split(TMP, MNUM, ";"); i; i--) MON[MNUM[i]]=i
} ...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 11
Views: 343
Posted By RudiC
You might as well consider this adaption of your...

You might as well consider this adaption of your original code:

R=$'\033[0;31m'
N=$'\033[0m'
cat <<-EOF

1 - db_a
2 - db_b
3 - db_c
4 - db_g
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 7
Views: 299
Posted By RudiC
You wanted to use the date command ... try grep...

You wanted to use the date command ... try
grep -Eo "[A-Z][a-z]* [0-9]{1,2} [0-9]{4}" /tmp/sample.txt |
LC_ALL=C date -f- +"%B %-d %Y:%F" |
awk '
NR == FNR {T[$1] = $2
...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 11
Views: 343
Posted By RudiC
Yes. After trying and finding out myself, I...

Yes. After trying and finding out myself, I noticed the subtle difference in R and N assignments between post#2 and #5 - the $ sign!
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 11
Views: 343
Posted By RudiC
With my system, above PS3 assignment doesn't give...

With my system, above PS3 assignment doesn't give satisfying results. man bash:


Note - it is NOT expanded!



You may want to try this circumnavigation:

PS3=$(printf $'\n'"${R}Choose...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 11
Views: 343
Posted By RudiC
With bash you have the select statement. Try ...

With bash you have the select statement. Try
OPTIONS="db_a db_b db_c db_g db_o db_e db_k db_t"
PS3="Choose database: "
select ORACLE_SID in $OPTIONS; do echo $ORACLE_SID; HOST=${ORACLE_SID}_qa;...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 4
Views: 191
Posted By RudiC
Try awk -v string="12_1234" -v...

Try
awk -v string="12_1234" -v serch="^[0-9]+_+[0-9][0-9][0-9][0-9]$" "BEGIN{ if (match (string,serch)) print string }"
12_1234
Showing results 1 to 25 of 500

 


All times are GMT -4. The time now is 01:08 AM.