A civil engineer with a longlife fondness for Software Libero
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:
Using Parameter expansion: ${String/pattern/replacement}
Using the sed command: sed 's/pattern/replacement/' filename
Using the awk command: "input_str" | awk 'pattern { action }'
Using the perl command: perl [options] -e 'action' filename
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.
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.
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…. 😀 😁
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!
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.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptRead More
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.