Source: https://stackoverflow.com/a/12152669
$ echo "App.tsx" | cut -f 1 -d '.'
# returns "App"
-f
select which segment-d '.'
use.
as the delimiter
Source: https://itnext.io/upgrading-bash-on-macos-7138bd1066ba
#!/usr/bin/env bash
echo "Using bash $BASH_VERSION"
Inspect the path and use the first encountered bash executable as the interpreter for the script. Good when the user has overridden the default version. E.g. I updated bash when I got a new MacBook.
for file in *; do git mv "$file" "${file%.js}.ts"; done;
https://stackoverflow.com/a/1225236
for i in "${arrayName[@]}"
do
echo $i
done
or
for i in {1..10}; do echo $i; done
while IFS= read -r line; do
echo "$line"
done < filename.txt
echo "$(date '+%Y-%m-%dT%H:%M:%S')"