Search Results

Search: Posts Made By: neutronscott
Forum: What is on Your Mind? 12-28-2018
774
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...
8,505
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,821
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...
3,617
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
2,449
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,295
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...
31,008
Posted By SriniShoo
df -Ph And then try your awk code
df -Ph
And then try your awk code
5,812
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
21,684
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
2,393
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...
13,859
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...
2,875
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...
10,275
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,077
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...
1,946
Posted By Scrutinizer
Or: c=$(printf "%0*d" "$a"...
Or:
c=$(printf "%0*d" "$a" "$b")
1,950
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...
3,757
Posted By vbe
moved to new thread...
moved to new thread...
3,252
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,828
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...
168,500
Posted By Perderabo
Days Elapsed Between 2 Dates
We really don't (yet) have a posting that addresses the general problem of number of days between two dates. So I have just finished what should be the last date calculation script that I ever...
2,930
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,543
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...
5,826
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,604
Posted By Scrutinizer
101 :) -- #3Я3 15 4 7357 4 5eЯ10v5...
101 :)


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

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

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