LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Intro (https://www.linuxquestions.org/questions/linuxquestions-org-member-intro-24/)
-   -   Hello from Arizona (https://www.linuxquestions.org/questions/linuxquestions-org-member-intro-24/hello-from-arizona-4175682282/)

LSnodgrass 09-17-2020 09:21 AM

Hello from Arizona
 
Very interested in Embedded Linux, config management, regular expressions, command line 'pipeline' puzzles and solutions.

Puzzles like this:

# For each text file in this directory,
# replace the row (line) in the file beginning with <path//>
# with "<path//>" and the fully qualified pathname
# something like
# <path//> /c/Users/john.smith/Documents/glossary.txt
#
# And better yet, perform a regex on the 'realpath' value, changing it into a
# Windows path like this:
# <path//> C:/Users/john.smith/Documents/glossary.txt
#
for filename in $(find . -type f -depth 1 -iname '*.txt' | xargs realpath)
do
sed -i.bak -n -e '/<path\/\/>/ {s/<path\/\/>.*$/<path\/\/> ${filename}/ }' ${filename}
echo Done ${filename}
done

# Again, this is just an introduction, not a legitimate post for assistance.
# And no, the bash + sed script above doesn't work yet.
# It's "the kind of" problems I am interested in solving from the command line
# as opposed to other solutions like writing a custom C, C++, C#, Python, Perl, PowerShell
# script.
#

A quote I really like:
"The best way to learn something is to try explaining it to the computer."

ondoho 09-19-2020 03:44 AM

Welcome to LQ, LSnodgrass!

greencedar 09-19-2020 05:46 PM

Welcome to the forum. :hattip: Looking forward to your participation.

linustalman 09-20-2020 03:53 AM

Greetings, LSnodgrass, and welcome to LQ! :hattip:

Timothy Miller 09-20-2020 08:30 PM

Welcome to a fellow Arizonan!!

frankbell 09-20-2020 09:48 PM

Quote:

A quote I really like:
"The best way to learn something is to try explaining it to the computer."
I can't attest to that, but, as an old classroom instructor, I can say that I probably learned more about [subject] by teaching it 20 times than my trainees learned by hearing it once!

rokytnji 09-21-2020 12:28 PM

Quote:

A quote I really like:

If it ain’t broke do fix it!


Howdy and Welcome.


All times are GMT -5. The time now is 02:07 PM.