Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #bash #multiple #commands #line
ADD COMMENT
Topic
Name
3+4 =