ffmpeg -f concat -safe 0 -i <(printf "file '%s'\n" "$HOME/Downloads/clip1.mov" "$HOME/Downloads/clip2.mov") -c copy $HOME/Downloads/output.mov
Windows Powershell Commands
Check if profile exists
Test-Path $PROFILE
Create profile if it doesn't exist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Quitting | |
| :x Exit, saving changes | |
| :q Exit as long as there have been no changes | |
| :wq Write and Quit. Saves any changes made to the file | |
| ZZ Exit and save changes if any have been made | |
| :q! Exit and ignore any changes | |
| Inserting Text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Make the script to abort if any command fails. Use set +e to change the behaviour and ignore failed command. | |
| set -e | |
| # Prints the commands as it is executed. Useful for debugging. Use set +x to disable debugging. | |
| set -x | |
| # Set default values | |
| ORGANISATION_NAME="${ORGANISATION_NAME:-com.example}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Make the script to abort if any command fails. Use set +e to change the behaviour and ignore failed command. | |
| set -e | |
| # Uncomment below line to print the commands as it is executed. Useful for debugging. Use set +x to disable debugging. | |
| # set -x | |
| # Source the functions from an url | |
| source <(curl -s "https://gist.githubusercontent.com/harishkannarao/58d317f2743c842b5323165a492db81c/raw/75ee691d4d4568c59443a070c6e5d192d717b6bc/reusable_functions.sh") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function add() | |
| { | |
| echo "$1 + $2" | bc -l | |
| } | |
| function subtract() | |
| { | |
| echo "$1 - $2" | bc -l |
The following blog post shows example of bash script with for loop, while loop, if elif else conditional statements.
- Conditional while loop
- While loop to iterate over lines in a file
- Infinite while loop with break and continue
- Infinite while loop with sleep
- Iterate over arguments passed as input using for loop
- For loop with counter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Make the script to abort if any command fails. Use set +e to change the behaviour and ignore failed command. | |
| set -e | |
| # Uncomment below line to print the commands as it is executed. Useful for debugging. Use set +x to disable debugging. | |
| # set -x | |
| echo "Example of numerical comparison with if elif else" | |
| for (( c=-5; c<=5; c=$c+1 )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Make the script to abort if any command fails. Use set +e to change the behaviour and ignore failed command. | |
| set -e | |
| # Uncomment below line to print the commands as it is executed. Useful for debugging. Use set +x to disable debugging. | |
| # set -x | |
| while [[ $# -gt 0 ]] | |
| do |
NewerOlder