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." |
Welcome to LQ, LSnodgrass!
|
Welcome to the forum. :hattip: Looking forward to your participation.
|
Greetings, LSnodgrass, and welcome to LQ! :hattip:
|
Welcome to a fellow Arizonan!!
|
Quote:
|
|
All times are GMT -5. The time now is 02:07 PM. |