skip to Main Content

Regex to extract multiple words from a paragraph – Debian

$ echo file.txt NAME="Ubuntu" <--- some of this VERSION="20.04.4 LTS (Focal Fossa)" <--- and some of this ID=ubuntu ID_LIKE=debian VERSION_ID="20.04" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal I want this: Ubuntu 20.04.4 LTS. I managed with two commands: echo "$(grep '^NAME="' ./file.txt | sed…

VIEW QUESTION

Redis – How to properly use regex to search from a command's output in Bash?

I have a command lando info which has a fairly large multi-line output: [ { service: 'appserver', urls: [ 'https://localhost:52836', 'http://localhost:52837', 'http://if-build-d9.lndo.site/', 'https://if-build-d9.lndo.site/' ], type: 'php', healthy: true, via: 'apache', webroot: './web', config: { php: '/Users/runo/.lando/config/drupal9/php.ini' }, version: '7.3', meUser:…

VIEW QUESTION
Back To Top
Search