From 9936cfe16b5848e4cf28923ce015d439f309a921 Mon Sep 17 00:00:00 2001 From: Travis Avey Date: Fri, 15 May 2026 15:44:48 -0400 Subject: [PATCH] Source code migrated from gitlab --- 001LoopWithHereDoc/config.yaml | 17 ++++++++++ 001LoopWithHereDoc/fruits.txt | 9 +++++ 001LoopWithHereDoc/make_config.sh | 17 ++++++++++ 002TipsTricks/tips.sh | 55 +++++++++++++++++++++++++++++++ README.md | 3 ++ 5 files changed, 101 insertions(+) create mode 100644 001LoopWithHereDoc/config.yaml create mode 100644 001LoopWithHereDoc/fruits.txt create mode 100755 001LoopWithHereDoc/make_config.sh create mode 100644 002TipsTricks/tips.sh create mode 100644 README.md diff --git a/001LoopWithHereDoc/config.yaml b/001LoopWithHereDoc/config.yaml new file mode 100644 index 0000000..d64e297 --- /dev/null +++ b/001LoopWithHereDoc/config.yaml @@ -0,0 +1,17 @@ +--- +Employees: +- name: Jim Halpert + department: sales +- name: Dwight Schrute + department: sales +--- +Fruits: + - apples + - bananums + - strawberries + - cherrums + - oranges + - raspberries + - kiwis + - blackberries + - mangos diff --git a/001LoopWithHereDoc/fruits.txt b/001LoopWithHereDoc/fruits.txt new file mode 100644 index 0000000..8cfe905 --- /dev/null +++ b/001LoopWithHereDoc/fruits.txt @@ -0,0 +1,9 @@ +apples +bananums +strawberries +cherrums +oranges +raspberries +kiwis +blackberries +mangos diff --git a/001LoopWithHereDoc/make_config.sh b/001LoopWithHereDoc/make_config.sh new file mode 100755 index 0000000..4131dc2 --- /dev/null +++ b/001LoopWithHereDoc/make_config.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +cat <config.yaml +--- +Employess: +- name: Jim Halpert + department: sales +- name: Dwight Schrute + department: sales +--- +Fruits: +$( + while read line; do + printf '\t%s %s\n' "-" $line + done uname.log + +# the > truncates the file, it will erase everything and +# add in the new contents +# +# the >> appends to the file, it will add in after the last +# the file + +# awk is useful for parsing text from previous output +nmcli c show | awk '{ print $1 }' +nmcli c show | grep '\-\-' | awk '{ print $2; }' | while read con; do sudo nmcli c delete $con; done + +# just run a really long command but made an error? +# fix command -- this will put the command into your system's +# text editor (nano,vim,emacs,etc) +# as soon as you save and quit, it will run with your changes +fc + +# how about an on-the-fly shell script? +# hold: control + x + e +# acts much like fc +# write out the script you want and save and quit + +# disown +# if you have a really long running process that your server might kick you off +# depending on the ssh timeout +# run control + x to put it in the bg +bg +disown -a +exit diff --git a/README.md b/README.md new file mode 100644 index 0000000..7e5088d --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Bash Tutorials + +Hopefully, simple tuts to help you learn bash/zsh