The Software Is Provided "As Is", Without Warranty Of Any Kind, Express Or Implied, Including But Not Limited To The Warranties Of Merchantability, Fitness For A Particular Purpose And Noninfringement. In No Event Shall The Authors Or Copyright Holders Be Liable For Any Claim, Damages Or Other Liability, Whether In An Action Of Contract, Tort Or Otherwise, Arising From, Out Of Or In Connection With The Software Or The Use Or Other Dealings In The Software.
Topic | Description | Link |
---|---|---|
Topic 1 | Basic script | https://github.com/AmaranthineTech/ShellScripts#topic-1 |
Topic 2 | Managing data | https://github.com/AmaranthineTech/ShellScripts#topic-2 |
Topic 3 | Condition checks | https://github.com/AmaranthineTech/ShellScripts#topic-3 |
Topic 4 | Documentation | https://github.com/AmaranthineTech/ShellScripts#topic-4 |
Topic 5 | Loops | https://github.com/AmaranthineTech/ShellScripts#topic-5 |
Topic 6 | User interaction | https://github.com/AmaranthineTech/ShellScripts#topic-6 |
Topic 7 | Miscellaneous | https://github.com/AmaranthineTech/ShellScripts#topic-7 |
Topic 8 | Arrays & Dictionaries | https://github.com/AmaranthineTech/ShellScripts#topic-8 |
Topic 9 | Automating scripts | https://github.com/AmaranthineTech/ShellScripts#topic-9 |
Topic 10 | Distribution | https://github.com/AmaranthineTech/ShellScripts#topic-10 |
https://arunpatwardhan.com/2021/06/10/shell-scripting-in-macos-part-1/
The folderCreator.zsh script is the script from the first blog article.
You can download the script and make changes to it.
zsh folderCreator.zsh
chmod ugo+x folderCreator.zsh
./folderCreator.zsh
This command assumes you are in the correct folder.
https://arunpatwardhan.com/2021/07/02/shell-scripting-in-macos-part-2/
The folderCreator_v1-1.zsh script is the script from the second blog article.
You can download the script and make changes to it.
zsh folderCreator_v1-1.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
zsh folderCreator_v1-1.zsh Tools Reports Help
chmod ugo+x folderCreator_v1-1.zsh
./folderCreator_v1-1.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
./folderCreator_v1-1.zsh Tools Reports Help
This command assumes you are in the correct folder.
https://arunpatwardhan.com/2021/07/16/shell-scripting-in-macos-part-3-condition-checks/
The folderCreator_v1-2.zsh script is the script from the second blog article.
You can download the script and make changes to it.
zsh folderCreator_v1-2.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
zsh folderCreator_v1-2.zsh Tools Reports Help
https://arunpatwardhan.com/2021/07/08/shell-scripting-in-macos-part-4-documentation-and-help/
The folderCreator_v1-3.zsh script is the script from the third blog article.
You can download the script and make changes to it.
NOTE: Going forward the command will simply be referred to as folderCreator.zsh. Whenever, we mention this command we are talking about the version in context. So in this case, for topic 4, folderCreator.zsh simply refers to folderCreator_v1-3.zsh.
zsh folderCreator.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
zsh folderCreator.zsh Tools Reports Help
chmod ugo+x folderCreator.zsh
./folderCreator.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
./folderCreator.zsh Tools Reports Help
These commands assumes you are in the correct folder.
zsh folderCreator.zsh -h
./folderCreator.zsh -help
These commands assumes you are in the correct folder.
zsh folderCreator.zsh -v
./folderCreator.zsh -version
These commands assumes you are in the correct folder.
https://arunpatwardhan.com/2022/12/19/shell-scripting-in-macos-part-5-loops/
The folderCreator_v1-4.zsh script is the script from the fifth blog article.
You can download the script and make changes to it.
NOTE: Going forward the command will simply be referred to as folderCreator.zsh. Whenever, we mention this command we are talking about the version in context. So in this case, for topic 5, folderCreator.zsh simply refers to folderCreator_v1-4.zsh.
zsh folderCreator.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
zsh folderCreator.zsh Tools Reports Help
chmod ugo+x folderCreator.zsh
./folderCreator.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
./folderCreator.zsh Tools Reports Help
These commands assumes you are in the correct folder.
zsh folderCreator.zsh -h
./folderCreator.zsh -help
These commands assumes you are in the correct folder.
zsh folderCreator.zsh -v
./folderCreator.zsh -version
These commands assumes you are in the correct folder.
https://arunpatwardhan.com/2022/12/19/shell-scripting-in-macos-part-6-user-interaction/
The folderCreator_v1-5.zsh script is the script from the sixth blog article.
You can download the script and make changes to it.
NOTE: Going forward the command will simply be referred to as folderCreator.zsh. Whenever, we mention this command we are talking about the version in context. So in this case, for topic 6, folderCreator.zsh simply refers to folderCreator_v1-5.zsh.
zsh folderCreator.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
zsh folderCreator.zsh Tools Reports Help
chmod ugo+x folderCreator.zsh
./folderCreator.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
./folderCreator.zsh Tools Reports Help
These commands assumes you are in the correct folder.
zsh folderCreator.zsh -h
./folderCreator.zsh -help
These commands assumes you are in the correct folder.
zsh folderCreator.zsh -v
./folderCreator.zsh -version
These commands assumes you are in the correct folder.
https://arunpatwardhan.com/2022/05/07/shell-scripting-in-macos-part-7-miscellaneous/
The folderCreator_v1-6.zsh script is the script from the third blog article.
You can download the script and make changes to it.
NOTE: Going forward the command will simply be referred to as folderCreator.zsh. Whenever, we mention this command we are talking about the version in context. So in this case, for topic 7, folderCreator.zsh simply refers to folderCreator_v1-6.zsh.
zsh folderCreator.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
zsh folderCreator.zsh Tools Reports Help
chmod ugo+x folderCreator.zsh
./folderCreator.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
./folderCreator.zsh Tools Reports Help
These commands assumes you are in the correct folder.
zsh folderCreator.zsh -h
./folderCreator.zsh -help
These commands assumes you are in the correct folder.
zsh folderCreator.zsh -v
./folderCreator.zsh -version
These commands assumes you are in the correct folder.
https://arunpatwardhan.com/2023/01/25/shell-scripting-in-macos-part-8-arrays-dictionaries/
The folderCreator_v1-7.zsh script is the script from the third blog article.
You can download the script and make changes to it.
NOTE: Going forward the command will simply be referred to as folderCreator.zsh. Whenever, we mention this command we are talking about the version in context. So in this case, for topic 8, folderCreator.zsh simply refers to folderCreator_v1-7.zsh.
zsh folderCreator.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
zsh folderCreator.zsh Tools Reports Help
chmod ugo+x folderCreator.zsh
./folderCreator.zsh <folder name 1> <folder name 2> <folder name 3>
Example:
./folderCreator.zsh Tools Reports Help
These commands assumes you are in the correct folder.
zsh folderCreator.zsh -h
./folderCreator.zsh -help
These commands assumes you are in the correct folder.
zsh folderCreator.zsh -v
./folderCreator.zsh -version
These commands assumes you are in the correct folder.
https://arunpatwardhan.com/2023/01/25/shell-scripting-in-macos-part-9-automating-scripts/
This topic uses the answers.sh along with the questions.sh script together. The welcome.zsh is used along with the in.amaranthine.welcomeMessage.plist/
You can download the script and make changes to it.
NOTE: We do not use the folderCreator.zsh script in this article.
Example:
zsh answers.zsh
cp welcome.zsh /Library/Scripts
chmod 755 /Library/Scripts/welcome.zsh
sudo chown root:wheel /Library/Scripts/welcome.zsh
cp in.amaranthine.welcomeMessage.plist /Library/Launch\ Daemons/
chmod 644 /Library/Launch\ Daemons/in.amaranthine.welcomeMessage.plist
sudo chown root:wheel /Library/Launch\ Daemons/in.amaranthine.welcomeMessage.plist
sudo launchctl bootstrap system /Library/Launch\ Daemons/in.amaranthine.welcomeMessage.plist
sudo launchctl list | grep "in.amaranthine.*"
sudo launchctl bootout system /Library/Launch\ Daemons/in.amaranthine.welcomeMessage.plist
These commands assumes you are in the correct folder.
https://arunpatwardhan.com/2023/02/02/shell-scripting-in-macos-part-10-distribution/
The folderCreator.zsh script is the script from the third blog article.
You can download the script and make changes to it.
NOTE: *Going forward the command will simply be referred to as folderCreator.zsh. Whenever, we mention this command we are talking about the version in context. *
cp folderCreator.zsh /usr/local/bin/folderCreator
chmod 755 /usr/local/bin/folderCreator
folderCreator <folder name 1> <folder name 2> <folder name 3>
These commands assumes you are in the correct folder.
cd /usr/local/share/man
mkdir man1
cp folderCreator.1 /usr/local/share/man/man1
man folderCreator
NOTE: *In case none of the commands work as is then make sure you have placed the items in the correct folder. This will require admin access to the computer. The /usr folder is hidden in the GUI by default. *
These commands assumes you are in the correct folder.