PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Table of Contents

Bash Structure

Let's start by creating a new file with a .sh extension, as an example we could create a file called devdojo.sh.

To create that file, you can use the touch command:

touch devdojo.sh

Or you can use your text editor instead:

nano devdojo.sh

In order to execute/run a bash script file with the bash shell interpreter, the first line of a script file must indicate the absolute path to the bash executable:

#!/bin/bash

This is also called a Shebang. All that the shebang does is to instruct the operating system to run the script with the /bin/bash executable.

let checkoutBtns = document.getElementsByClassName("checkout"); for( var i=0; i < checkoutBtns.length; i++ ){ if(checkoutBtns[i].dataset.redirect){ redirectAfterPurchase = checkoutBtns[i].dataset.redirect; } checkoutBtns[i].addEventListener('click', openCheckout, false); } function openCheckout(e) { let checkoutButton = e.currentTarget; let productCheckout = parseInt('593446'); if(checkoutButton.dataset.product){ productCheckout = checkoutButton.dataset.product; } let couponCheckout = ''; if(checkoutButton.dataset.coupon){ couponCheckout = checkoutButton.dataset.coupon; } Paddle.Checkout.open({ product: productCheckout, email: '', successCallback: "checkoutComplete", coupon: couponCheckout, }); } let updateBtns = document.getElementsByClassName("update-account"); for( var i=0; i < updateBtns.length; i++ ){ updateBtns[i].addEventListener('click', updateAccount, false); } function updateAccount(){ Paddle.Checkout.open({ override: this.dataset.url, successCallback: "updateCancelComplete", }); } let cancelBtns = document.getElementsByClassName("cancel-account"); for( var i=0; i < cancelBtns.length; i++ ){ cancelBtns[i].addEventListener('click', cancelAccount, false); } function cancelAccount(){ Paddle.Checkout.open({ override: this.dataset.url, successCallback: "cancelComplete", }); } -->