Search Results

Search: Posts Made By: Ardzii
Forum: OS X (Apple) 01-31-2017
9,469
Posted By bakunin
Yes - and no. Yes, the better you define what you...
Yes - and no. Yes, the better you define what you want the better results you will get. No, this has nothing to do with greedyness. Greedyness is the fact that if there several possible matches for a...
Forum: OS X (Apple) 01-31-2017
9,469
Posted By RudiC
Your first pattern doesn't match for two reasons,...
Your first pattern doesn't match for two reasons, of which you found and (roughly) eliminated one (congrats!): As the pattern is anchored at begin-of-line with the ^ [/ICODE, you need to allow for...
Forum: OS X (Apple) 01-30-2017
9,469
Posted By bakunin
The force flows strong in me, LOL! ...
The force flows strong in me, LOL!



Actually you came very close. What you didn't get was the part i left out in my little introduction, so here is part two:

Grouping
To combine several...
Forum: OS X (Apple) 01-30-2017
9,469
Posted By MadeInGermany
The /2 option does not work if the .* has already...
The /2 option does not work if the .* has already matched too much. For example
echo "name something name something" | sed -n 's/.*name/XXXX/p'
XXXX something
echo "name something name something"...
Forum: OS X (Apple) 01-26-2017
9,469
Posted By bakunin
Very good! sed might be "love at third sight",...
Very good! sed might be "love at third sight", but it is an immensely mighty tool.

Here is a very short introduction to my favourite topic:

Regular Expressions

Regular expressions are...
Forum: OS X (Apple) 01-26-2017
9,469
Posted By MadeInGermany
Exactly. The first character that matches in the...
Exactly. The first character that matches in the trailing .* is a quote.
As I said, the leading and trailing .* are needed to "match away" the entire line. Otherwise only the matching portion would...
Forum: OS X (Apple) 01-26-2017
9,469
Posted By MadeInGermany
[^"] is a character that is not a quote [^"]*...
[^"] is a character that is not a quote
[^"]* is any consecutive number of non-quote characters
\( \) does not mean a character but is a group mark, for later reference...
Forum: OS X (Apple) 01-16-2017
9,469
Posted By bakunin
As vgersh99 already noted "grep" comes from...
As vgersh99 already noted "grep" comes from "g/re/p", which is a (schematised) sed-command. Let us see if i can help to improve your understanding:

grep is basically a line filter: you feed it a...
Forum: OS X (Apple) 01-16-2017
9,469
Posted By vgersh99
grep stands for 'g/re/p' of sed [where g is...
grep stands for 'g/re/p' of sed [where g is Global, re is RegularExpression and p is Print]
Forum: OS X (Apple) 01-16-2017
9,469
Posted By RudiC
I don't think so, generally. grep is not intended...
I don't think so, generally. grep is not intended nor designed to replace or remove patterns or partial strings. Be aware that sed has similar powerful matching algorithms as grep has.
In your...
Forum: OS X (Apple) 01-13-2017
9,469
Posted By MadeInGermany
local means: the variable exists only within the...
local means: the variable exists only within the current scope.
In Bash: within the current function.
Bash is not a declarative language, and has loose type binding.
For example you can add a 1 to...
Forum: OS X (Apple) 01-13-2017
9,469
Posted By MadeInGermany
Another comment. "href.*view more" works the...
Another comment.
"href.*view more" works the same with ERE and RE, so egrep can be replaced by grep.
And because sed takes an RE and does not yet have one, you can move it to sed
link=$(
curl...
Forum: OS X (Apple) 01-12-2017
9,469
Posted By bakunin
Even if i am not RudiC: you do quite fine. ...
Even if i am not RudiC: you do quite fine.



In (german) medicine there is a proverb: who heals is right. In programming the same is true: as long as a program is doing what it is supposed to do...
Forum: OS X (Apple) 12-27-2016
9,469
Posted By RudiC
If you'd accept a trailing comma (removal would...
If you'd accept a trailing comma (removal would need additional measures), set the output record separator to comma: ORS=",". As ALL info would come in a long line, then, we need to find out how to...
Forum: OS X (Apple) 12-26-2016
9,469
Posted By RudiC
A wee bit improved so you can add the search...
A wee bit improved so you can add the search words at the end as parameters separated by pipe symbols:


curl -s...
Forum: OS X (Apple) 12-26-2016
9,469
Posted By RudiC
This may serve as a starting point (file contains...
This may serve as a starting point (file contains the web content downloaded before):

awk '/href.*view more/ {sub (/^[^<]*<a href="/, "curl -s https://www.dotmed.com")
sub...
Forum: OS X (Apple) 12-23-2016
9,469
Posted By RudiC
Please back these details up with input samples...
Please back these details up with input samples and how and where to get those! How to identify the data you need. You don't expect people in here to crawl through all those sites, do you?
Forum: OS X (Apple) 12-23-2016
9,469
Posted By RudiC
Thanks for the system details. I'm not familiar...
Thanks for the system details. I'm not familiar with the macOS, and the bash version is somewhat aged, but you might get along.

So, now we have a text to work upon. What do you want to extract...
Forum: OS X (Apple) 12-22-2016
9,469
Posted By RudiC
Welcome to the forum. It is always...
Welcome to the forum.

It is always beneficial to post the OS and shell version you are using as well as tools and their versions (e.g. awk, sed, ...) available.

This is not a new request; it...
Showing results 1 to 19 of 19

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