Desktop scripting/sh

From Adam Meola - wiki
< Desktop scripting
Revision as of 16:13, 2 September 2020 by Adam (talk | contribs)
Jump to navigation Jump to search

SH scripting!

(available on POSIX systems)

With an SH script, almost anything you can in the terminal can be written in advance, and played back at your leisure.


Setting up an SH script

1) cd to the folder where you'd like to save your script
2) run:
touch [nameYourFileHere].sh
  • this will create a blank plain text file of that name
3) Open the file you've just created
  • Use whatever you like to open it. VIM, nano, gedit, Atom, vsCode, etc are all fine
4) Write your script.
1) set the language that you'll be scripting in
  • Your can use any language available to your terminal
  • I always use bash, so my example is for bash:
  • on the first line of your file, paste:
#!/bin/bash

Using an SH script