This started with be exploring "regular expressions".
I discovered some tutorials that were using Bash in their samples.
One {lost the reference at the moment} was almost a match for a real
world problem I have.
But I've not used Bash in eons and have forgotten how to read a file
into a single variable or a array variable.
I've downloaded "Bash Reference Manual"
 [https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html]
for when I need fine grained details.
I've bookmarked the various links on
 [https://mywiki.wooledge.org/BashFAQ]
for quick reference.
I find neither to be search friendly.
Suggestions?
TIA
This started with be exploring "regular expressions".
I discovered some tutorials that were using Bash in their samples.
One {lost the reference at the moment} was almost a match for a real
world problem I have.
But I've not used Bash in eons and have forgotten how to read a file
into a single variable or a array variable.
I've downloaded "Bash Reference Manual"
[https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html]
for when I need fine grained details.
I've bookmarked the various links on
[https://mywiki.wooledge.org/BashFAQ]
for quick reference.
I find neither to be search friendly.
Suggestions?
TIA
This started with be exploring "regular expressions".
I discovered some tutorials that were using Bash in their samples.
One {lost the reference at the moment} was almost a match for a real
world problem I have.
But I've not used Bash in eons and have forgotten how to read a file
into a single variable or a array variable.
I've downloaded "Bash Reference Manual"
[https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html]
for when I need fine grained details.
I've bookmarked the various links on
[https://mywiki.wooledge.org/BashFAQ]
for quick reference.
I find neither to be search friendly.
Suggestions?
TIA
On 2024-09-07 11:50, Richard Owlett wrote:
This started with be exploring "regular expressions".
I discovered some tutorials that were using Bash in their samples.
One {lost the reference at the moment} was almost a match for a real
world problem I have.
But I've not used Bash in eons and have forgotten how to read a file
into a single variable or a array variable.
I've downloaded "Bash Reference Manual"
[https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html]
for when I need fine grained details.
I've bookmarked the various links on
[https://mywiki.wooledge.org/BashFAQ]
for quick reference.
I find neither to be search friendly.
Suggestions?
TIA
When I've been in the same position, I don't know that I have a single
go-to resource. Instead I tend to search for what I'm wanting to do at
the moment and then check out results that seem relevant from https://stackoverflow.com/. I usually have pretty good luck there. https://devhints.io/bash may be helpful, and a couple of the other pages linked at the top looked pretty good, too (e.g. the wiki you referenced).
Unsolicited thoughts: When it comes to regexes (regular expressions),
the syntax can depend on where/in what (programming) language or
application you're using it. When I was trying to sort it all out I
stumbled upon https://www.regular-expressions.info/, which was a big
help to me. If you click on "Tools & Languages" at the top of the page,
you can also get explanations for how regexes are implemented in your particular context. I used this site as a reference while trying to pull
data out of log files at work in a text editor (Sublime Text, which I
highly recommend for immediate feedback on your regex attempts). If you
don't have a big file to practice with, try saving one of the links on https://openbible.com/texts.htm for a copy of the Christian Bible in a
single text file. I'm sure there's other text files like that out there
if that's not your cup of tea. Good luck with regex; each time I need it
is a fun and useful puzzle to solve.
Quaeryth
A query like "site:stackoverflow.com bash how to read file into variable" via Google or DuckDuckGo (and maybe other search engines) usually points me in the right direction. Good luck with your experiments!
This started with be exploring "regular expressions".
I discovered some tutorials that were using Bash in their samples.
One {lost the reference at the moment} was almost a match for a real
world problem I have.
But I've not used Bash in eons and have forgotten how to read a file
into a single variable or a array variable.
I've downloaded "Bash Reference Manual"
[https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html] for
when I need fine grained details.
I've bookmarked the various links on
[https://mywiki.wooledge.org/BashFAQ]
for quick reference.
I find neither to be search friendly.
Suggestions?
TIA
On Sat, Sep 07, 2024 at 22:00:27 +0000, Quaeryth wrote:
A query like "site:stackoverflow.com bash how to read file into variable" via
Google or DuckDuckGo (and maybe other search engines) usually points me in >> the right direction. Good luck with your experiments!
What kind of file?
What kind of variable?
What are you planning to do with the variable after you've stored data
in it?
[snip]
This started with exploring "regular expressions".
I discovered some tutorials that were using Bash in their samples.
One {lost the reference at the moment} was almost a match for a real
world problem I have. >
But I've not used Bash in eons and have forgotten how to read a file
into a single variable or a array variable.
On 08/09/2024 04:22, Richard Owlett wrote:
[My examples are from my experiments with re-formatting
text at https://ebible.org/engkjvcpb/ for comfortable reading by
fellow tri-focal wearing senior citizens - that I want to minimize the
number of HTML tags & eliminating all CSS usage annoys some HTML5
purists ;]
Instead of BASH and regular expression use some programming language
where a reliable HTML parser is available. E.g. in python you may use lxml.html.html5parser, lxml.etree.HTMLParser, BeautifulSoup.
Calibre aggressively strips CSS and some markup during conversion of
HTML pages to various ebook formats.
This started with exploring "regular expressions".
I discovered some tutorials that were using Bash in their samples.
Bash has some nifty uses when it comes to variables.
If you just want to store a file in a variable,
VAR="$(</path/to/file)
will do it. If you want to do an array instead, use the 'while read line;
do' construct. As others have pointed out, this is not an optimal usecase
for bash.
[My examples are from my experiments with re-formatting
text at https://ebible.org/engkjvcpb/ for comfortable reading by
fellow tri-focal wearing senior citizens
On Sun, 8 Sep 2024 16:25:04 +0100
debian-user@howorth.org.uk wrote:
Hello debian-user@howorth.org.uk,
Tell them to get a [very cheap] pair of single focus reading glasses
made to suit the distance their screen is away.
Richard Owlett <rowlett@access.net> wrote:
[My examples are from my experiments with re-formatting
text at https://ebible.org/engkjvcpb/ for comfortable reading by
fellow tri-focal wearing senior citizens
As a mere bifocal (well vari-focal) wearer can I suggest a different >approach. Stop wearing tri-focals or any other variable focus specs for >reading a computer screen. Tell them to get a [very cheap] pair of
single focus reading glasses made to suit the distance their screen is
away.
I did this years ago and wouldn't try to do it any other way now. The
bliss of being able to read the whole screen comfortably without moving
if I want to.
single focus reading glasses made to suit the distance their screen is
away.
As a mere bifocal (well vari-focal) wearer can I suggest a different approach. Stop wearing tri-focals or any other variable focus specs for reading a computer screen. Tell them to get a [very cheap] pair of
single focus reading glasses made to suit the distance their screen is
away.
On Mon 09 Sep 2024 at 04:47:20 (-0400), Anssi Saari wrote:
debian-user@howorth.org.uk writes:
As a mere bifocal (well vari-focal) wearer can I suggest a different approach. Stop wearing tri-focals or any other variable focus specs for reading a computer screen. Tell them to get a [very cheap] pair of
single focus reading glasses made to suit the distance their screen is away.
I don't agree at all. I've used fixed focus glasses before but I find
close range varifocals a huge upgrade. They're extremely useful for
monitor work *and also* I can see and read things around me that fall outside the extremely narrow focus range of single focus reading
glasses. I wonder if fixed focus even works for modern large two or
three monitor setups? I suppose it's fine for a single small screen.
Have you tried some different fonts? My eyesight is poor, and a good
font made all the difference.
https://bezoar.org/posts/2023/0214/font-screenshots/
--
Karl Vogel I don't speak for anyone but myself
Debugging: when you're the detective, the victim, and the criminal.
--seen on Reddit, 11 Jul 2024
debian-user@howorth.org.uk writes:
As a mere bifocal (well vari-focal) wearer can I suggest a different approach. Stop wearing tri-focals or any other variable focus specs for reading a computer screen. Tell them to get a [very cheap] pair of
single focus reading glasses made to suit the distance their screen is away.
I don't agree at all. I've used fixed focus glasses before but I find
close range varifocals a huge upgrade. They're extremely useful for
monitor work *and also* I can see and read things around me that fall
outside the extremely narrow focus range of single focus reading
glasses. I wonder if fixed focus even works for modern large two or
three monitor setups? I suppose it's fine for a single small screen.
Missed (deleted) the start of the discussion.
Not sure if it helps but:
I juste made public my toolbox.txt file: https://ychaouche.github.io/toolbox.txt
it is meant to be open in emacs,
so that you can use its outliner mode and read only what you're
interested in.
This is GNU Emacs 24.5.1 (i686-pc-linux-gnu, GTK+ Version 3.22.11)How do I display/activate "outliner mode"?
of 2017-09-12 on x86-grnet-01, modified by Debian
The relevant part is in "** command line tricks" (https://i.imgur.com/eqBjD0n.png)
You can also take a look at https://ychaouche.github.io/bash.txt,
but it is less of a "learn by doing" and more of a quick cheat sheet
that helps you write or read bash code.
I use these two files (and more) to organize and quickly access
knowledge gems,
so that once I learn something I need to remember 6 months from now,
I just look at one of the files
(or use my notes.search script,
but that's another topic).
Best,
On 09/08/2024 12:22 PM, Yassine Chaouche wrote:
Missed (deleted) the start of the discussion.
Not sure if it helps but:
I juste made public my toolbox.txt file:
https://ychaouche.github.io/toolbox.txt
it is meant to be open in emacs,
so that you can use its outliner mode and read only what you're
interested in.
I've never successfully used Emacs [an attempt made several months ago].
The GUI version is available on my machine.
HELP menu displays:
This is GNU Emacs 24.5.1 (i686-pc-linux-gnu, GTK+ Version 3.22.11)How do I display/activate "outliner mode"?
 of 2017-09-12 on x86-grnet-01, modified by Debian
Is appropriate "HELP" documentation of using "outliner mode" available
as web page?
The relevant part is in "** command line tricks"
(https://i.imgur.com/eqBjD0n.png)
I tried to display in my browser (SeaMonkey 2.49.4) and got only an
empty dark gray screen.
You can also take a look at https://ychaouche.github.io/bash.txt,
but it is less of a "learn by doing" and more of a quick cheat sheet
that helps you write or read bash code.
I assume that is also meant to be read using "outliner mode".
The notes will give me practice in reading French which I haven't done
since high school (1961).
Thanks for trying.
I use these two files (and more) to organize and quickly access
knowledge gems,
so that once I learn something I need to remember 6 months from now,
I just look at one of the files
(or use my notes.search script,
but that's another topic).
Best,
On Mon 09 Sep 2024 at 04:47:20 (-0400), Anssi Saari wrote:
I've used fixed focus glasses before but I find
close range varifocals a huge upgrade. They're extremely useful for
monitor work *and also* I can see and read things around me that fall
outside the extremely narrow focus range of single focus reading
glasses. I wonder if fixed focus even works for modern large two or
three monitor setups? I suppose it's fine for a single small screen.
Have you tried some different fonts? My eyesight is poor, and a good
font made all the difference.
https://bezoar.org/posts/2023/0214/font-screenshots/
debian-user@howorth.org.uk writes:
As a mere bifocal (well vari-focal) wearer can I suggest a different
approach. Stop wearing tri-focals or any other variable focus specs
for reading a computer screen. Tell them to get a [very cheap] pair
of single focus reading glasses made to suit the distance their
screen is away.
I don't agree at all. I've used fixed focus glasses before but I find
close range varifocals a huge upgrade. They're extremely useful for
monitor work *and also* I can see and read things around me that fall outside the extremely narrow focus range of single focus reading
glasses. I wonder if fixed focus even works for modern large two or
three monitor setups? I suppose it's fine for a single small screen.
So, not going back from my close range varifocals. I don't need
glasses otherwise.
George at Clug <Clug@goproject.info> writes:
Have you tried 100 Hz or greater monitors? All my monitors are 60Hz. I wonder if these help with prolonged computer use?
In my home setup one monitor does 75 Hz and the other 144 but I can't
see much, if any, difference in clarity compared to 60 Hz. Also I have
no idea how to configure that in Debian, I just quickly tested with my
work Windows laptop.
Have you tried 100 Hz or greater monitors? All my monitors are 60Hz. I wonder if these help with prolonged computer use?
Have you tried some different fonts? My eyesight is poor, and a good
font made all the difference.
https://bezoar.org/posts/2023/0214/font-screenshots/
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 02:13:43 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,581 |