Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash multiple commands one line

# Basic syntax:
# This will run command_2 after command_1 regardless of whether command_1
# completes successfully or not:
command_1; command_2
# This will run command_2 after command_1 if command_1 completes successfully:
command_1 && command_2
# This will run command_2 after command_1 if command_1 fails:
command_1 || command_2
# This will pass (pipe) the standard output of command_1 to command_2:
command_1 | command_2
Comment

bash for loop multiple commands one line

# Basic syntax:
for i in a b; do echo $i; printf "$i	$i
"; done
# Where:
#	- each command in the for loop needs to be separated by semicolons. Here
#		we echo $i and then print $i<tab>$i<newline>
#	- over several lines this would be equivalent to:
for i in a b
do
  echo $i
  printf "$i	$i
"
done
Comment

PREVIOUS NEXT
Code Example
Shell :: how to uninstall a software in ubuntu 
Shell :: ngrok command 80 not found 
Shell :: install axios 
Shell :: conda install regex 
Shell :: clean journal 
Shell :: copy folder linux 
Shell :: xampp ubuntu 
Shell :: vim insert text at the the beginning of multiple lines 
Shell :: tcpdump filter ip address 
Shell :: install specific version of node 
Shell :: env variables list ubuntu 
Shell :: commit in git 
Shell :: list remote branches git 
Shell :: starting nodemon server 
Shell :: composer install mac 
Shell :: how to install git in ubuntu ? 
Shell :: git create new branch from current 
Shell :: how to install flutter linux 
Shell :: grep exclude file extension 
Shell :: how to check is heroku git remote is added 
Shell :: how to run a sh file in terminal 
Shell :: how to install diskpart in ubuntu 
Shell :: install formik 
Shell :: add sudo user centos server group 
Shell :: ignore line format in git 
Shell :: ngrok start server 
Shell :: git save password 
Shell :: show debian point release 
Shell :: stop apache2 
Shell :: cmd copy all files to another folder 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =