Search Results

Search: Posts Made By: neutronscott
Forum: What is on Your Mind? 12-28-2018
545
Posted By Neo
Holiday Thoughts for the End of 2018
Happy Holidays.

Here are my randoms thought at the end of 2018 in no particular order.

You Are Truly Blessed

IT people are lucky. We get to use our brains extensively to solve complex and...
6,672
Posted By vgersh99
would something like this be helpful? awk -f...
would something like this be helpful?
awk -f tapi..awk channels.xml where tapi.awk is:

BEGIN {
srcD="/cygdrive/c/ProgramData/data/picons"
...
2,481
Posted By Don Cragun
Hi Xterra, The pipeline you have is logically...
Hi Xterra,
The pipeline you have is logically equivalent to:
cut -c5-600 FWD-1.fas
but runs slower since you're reading and writing the file twice instead of just once.

Hi Neutronscott,
I...
2,544
Posted By RudiC
But - hasn't that been shown to you in posts #2...
But - hasn't that been shown to you in posts #2 and #3?
awk -vb=XXX 'BEGIN {a=b?b:"Default"; print a}'
XXX
awk 'BEGIN {a=b?b:"Default"; print a}'
Default
1,884
Posted By Scrutinizer
Both suggestions could be reduced a bit, when...
Both suggestions could be reduced a bit, when taking into account sed's greedy matchin property, notably \[.*\] matches everything between the first square bracket until the last, from the point of...
Forum: What is on Your Mind? 06-12-2014
2,023
Posted By rbatte1
A few thoughts that might help you:- You might...
A few thoughts that might help you:-
You might need to work on your interfacing
Negotiating access is critical before attempting IO
Ensure you use the agreed port
Take virus protection...
26,793
Posted By SriniShoo
df -Ph And then try your awk code
df -Ph
And then try your awk code
4,377
Posted By alister
The shebang, #!/bin/bash ... is irrelevant; the...
The shebang, #!/bin/bash ... is irrelevant; the system(3) library function will use /bin/sh. The OP's /bin/sh does not support the necessary features (arrays, indirect vars).

Regards,
Alister
16,628
Posted By Don Cragun
Or more simply: awk -F '|' ' { for(i =...
Or more simply:
awk -F '|' '
{ for(i = 1; i <= NF; i++)
if($i == "SUB_ACC_NO") {
print i
exit
}
}' input
1,810
Posted By rbatte1
Might I suggest that you alter your SQL call to...
Might I suggest that you alter your SQL call to something like this:-
sqlplus -S <<-EOSQL | read col1 col2 col2 col3 col4 col5 col6
$user/$pass@$sid
set heading off
set pagesize 0

Your query...
10,378
Posted By alister
I am not sure it preserved literal newlines,...
I am not sure it preserved literal newlines, though. It may have only preserved them as spaces.[/QUOTE]
MadeInGermany is correct; the quotes are a no-op. Double quotes only prevent expansions which...
1,637
Posted By krishmaths
As neutronscott suggested, you may use the...
As neutronscott suggested, you may use the variables filename and data in the while loop.

Within the while loop you can refer to the filename using $filename and data using $data.

During first...
7,021
Posted By alister
A more efficient approach. if grep -q...
A more efficient approach.
if grep -q '\.order$'; then
echo match
else
echo no match
fi

It's more efficient in several ways.

First, fewer subshells need to be forked.

Second,...
2,402
Posted By Corona688
When you redirect into your while loop with <,...
When you redirect into your while loop with <, you are redirecting stdin from that file.

ssh, an interactive application, tries to use stdin as your keyboard, eating all your lines.

Use ssh -n...
1,568
Posted By Scrutinizer
Or: c=$(printf "%0*d" "$a"...
Or:
c=$(printf "%0*d" "$a" "$b")
1,594
Posted By Don Cragun
So close... This script stripped out the period...
So close...
This script stripped out the period (.) in the extension when setting ext and when setting base, but puts it back in the printf format string. It also strips out the vee (v) when...
2,718
Posted By vbe
moved to new thread...
moved to new thread...
2,817
Posted By methyl
Assuming that your file has records terminated...
Assuming that your file has records terminated with carriage-return line-feed, we can probably eliminate the format of the file.


There is a little-known "feature" of Microsoft Outlook where a...
2,350
Posted By agama
Be careful with something like this. While it...
Be careful with something like this. While it didn't appear in the small sample posted, if the input line contained something like


foo[bar] some other text[3]


The sed here would leave only...
2,634
Posted By Chirel
Hi, #!/bin/bash ...
Hi,


#!/bin/bash

apachever=$(/usr/local/apache/bin/httpd -v | head -1 | awk '{print $3}' |cut -d/ -f 2)
minval=$( echo -e "$apachever\n2.2.17" | sort -n -t . -k 1,1 -k 2,2 -k 3,3 | head -1 )...
1,286
Posted By alister
Keeping with that spirit, here's one in sh: ...
Keeping with that spirit, here's one in sh:

while IFS=\| read -r x y z; do
while [ ${#y} -lt 10 ]; do
y=${y}0
done
printf '%s|%s|%s\n' "$x" "$y" "$z"
done


Welcome to...
4,809
Posted By shamrock
awk -F\| '$9 ~...
awk -F\| '$9 ~ "^[a-zA-Z0-9]{2,3}/[a-zA-Z0-9]?/[a-zA-Z0-9]{6}"' file
Forum: What is on Your Mind? 05-21-2012
3,228
Posted By Scrutinizer
101 :) -- #3Я3 15 4 7357 4 5eЯ10v5...
101 :)


--
#3Я3 15 4 7357 4 5eЯ10v5 #40Я5:

https://www.unix.com/members/scrutinizer-albums-scrutinizer-picture469-shirthaxx0r.jpg
1,886
Posted By Scrutinizer
Alternatively try: awk '{while(NF<10 && getline...
Alternatively try:
awk '{while(NF<10 && getline p)$0=$0p}1' FS=\| OFS=\| infile
4,277
Posted By Scrutinizer
awk '$2=gsub(/./,"&")' infile
awk '$2=gsub(/./,"&")' infile
Showing results 1 to 25 of 31

 

Featured Tech Videos

All times are GMT -4. The time now is 10:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy