Paolo Redaelli personal blog

In bash scripting, the replacement of string is important because it allows you to modify a variable and the text of a file. It also helps in file and text processing and to validate user input.

To replace a string in bash, check the following methods:

  1. Using Parameter expansion: ${String/pattern/replacement}
  2. Using the sed command: sed 's/pattern/replacement/' filename
  3. Using the awk command: "input_str" | awk 'pattern { action }'
  4. Using the perl command: perl [options] -e 'action' filename
  5. Using the tr command: tr 'old_chars' 'new_chars' < "input_file"

Dive into the article to learn these methods of how to replace a bash string in detail.

Source: How to Replace String in Bash? [5 Methods] – LinuxSimply

Researchers Develop New Material That Converts CO2 into Methanol Using Sunlight

Posted by EditorDavid on Saturday March 30, 2024 @01:34PM from the fun-with-photocatalysis dept.

“Researchers have successfully transformed CO2 into methanol,” reports SciTechDaily, “by shining sunlight on single atoms of copper deposited on a light-activated material, a discovery that paves the way for creating new green fuels.” Tara LeMercier, a PhD student who carried out the experimental work at the University of Nottingham, School of Chemistry, said: “We measured the current generated by light and used it as a criterion to judge the quality of the catalyst. Even without copper, the new form of carbon nitride is 44 times more active than traditional carbon nitride. However, to our surprise, the addition of only 1 mg of copper per 1 g of carbon nitride quadrupled this efficiency. Most importantly the selectivity changed from methane, another greenhouse gas, to methanol, a valuable green fuel.”


Professor Andrei Khlobystov, School of Chemistry, University of Nottingham, said: “Carbon dioxide valorization holds the key for achieving the net-zero ambition of the UK. It is vitally important to ensure the sustainability of our catalyst materials for this important reaction. A big advantage of the new catalyst is that it consists of sustainable elements — carbon, nitrogen, and copper — all highly abundant on our planet.” This invention represents a significant step towards a deep understanding of photocatalytic materials in CO2 conversion. It opens a pathway for creating highly selective and tuneable catalysts where the desired product could be dialed up by controlling the catalyst at the nanoscale.

“The research has been published in the Sustainable Energy & Fuels journal of the Royal Society of Chemistry.”

Thanks to long-time Slashdot reader Baron_Yam for sharing the article.

From science.slashdot.org

Those are the good news we want to read!

ἀν + ἀρχός

Più passa il tempo più mi vien voglia di studiare il greco. Per esempio, Il greco antico è davvero una lingua affascinante. Peccato voglia prima imparare il CInese Mandarino, il Francese e il Russo…. 😀 😁

Resurrexit sicut dixit!

Regina cœeli

Regina cœli, laetare, alleluia;
Quia quem meruisti portare, alleluia,
Resurrexit, sicut dixit, alleluia:
Ora pro nobis Deum, alleluia.
Queen of heaven, rejoice, alleluia.
The Son you merited to bear, alleluia,
Has risen as he said, alleluia.
Pray to God for us, alleluia.[3]

I never say no to a new font. This is a nice Sans-serif font but frankly it doesn’t seem so “incredible”.

A new typeface – greater legibility and readability for low vision readers

Atkinson Hyperlegible font is named after Braille Institute founder, J. Robert Atkinson.  What makes it different from traditional typography design is that it focuses on letterform distinction to increase character recognition, ultimately improving readability.  We are making it free for anyone to use!

Source: Download the Atkinson Hyperlegible Font | Braille Institute

Recently, I’ve been interested in the DuckDB project (like a SQLite geared towards data applications). And one of the amazing features is that it has many data importers included without requiring extra dependencies. This means it can natively read and parse JSON as a database table, among many other formats.

I work extensively with JSON day to day, and I often reach for jq when exploring documents. I love jq, but I find it hard to use. The syntax is super powerful, but I have to study the docs anytime I want to do anything beyond just selecting fields.

Once I learned DuckDB could read JSON files directly into memory, I realized that I could use it for many of the things where I’m currently using jq. In contrast to the complicated and custom jq syntax, I’m very familiar with SQL and use it almost daily.

Source: DuckDB as the New jq