Bash #10 - Combining commands (skip waiting)

preview_player
Показать описание
In this video we'll cover three ways to combine and chain commands together in the Linux terminal using semi-colon, logical AND or logical OR operators. This will help you save a lot of time and automate checks.
#bash #bashscripting #terminal #linux

Timestamp:
0:00 Intro
0:17 operators to chain commands
1:16 semi-colon
1:38 when to use semi-colon
1:56 logical AND
2:52 logical OR
3:46 combine operators
4:05 grouping commands

Related video:

Used commands:
clear;ls -alt;pwd;uname -srmp;whoami
chmod +x script1
mkdir dir1 && cd dir1
sudo apt update && sudo apt upgrade -y
[ -x "script3" ] || chmod +x script3
[ -x "script1" ] && echo done
[ -x "script1" ] || echo done
ls -lt; [ -x "script1" ] && echo true || echo false
VAR="1"; echo "VAR: $VAR"; { VAR="2"; echo "inside VAR: $VAR"; }; echo "outside VAR: $VAR"
VAR="1"; echo "VAR: $VAR"; ( VAR="2"; echo "inside VAR: $VAR"; ); echo "outside VAR: $VAR"
[ -x "script3" ] || ( echo first && echo second )
Рекомендации по теме
Комментарии
Автор

You have very clean edits. Mind sharing what you use

justpatrick_