Skip to content

Instantly share code, notes, and snippets.

View ripleymj's full-sized avatar

Mike Ripley ripleymj

  • 06:00 (UTC -04:00)
View GitHub Profile
@dan4thewin
dan4thewin / bash4thewin.md
Last active June 8, 2024 19:16
Bash idioms and tools

This page collects a set of bash scripting idioms and tools for easy reference.

Improved Error Detection: set -e and set -u

With -e (errexit), bash exits immediately if an unchecked command exits with a nonzero value. A checked command is part of a while, until, if, elif, or an expression with && or ||. Everything else is unchecked. For a pipeline, only the last command is considered. Adding "or no-op", || :, ensures a command is safe, e.g., do-something | grep 'may_not_match' || :. NB. Calling a bash function in a checked context effectively disables -e for all commands in the function. Use the optional shellcheck, check-set-e-suppressed, to alert on this.

<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@iversond
iversond / applyPT856Upgrade.ps1
Created August 31, 2018 14:20
Powershell script to run the PeopleTools 8.56 Upgrade job headlessly. A few assumptions with the script: All manual steps are marked as complete.; your PT Client installs are at c:\client-8.xx.xx
<#PSScriptInfo
.SYNOPSIS
Apply the PeopleTools 8.56 Upgrade Project
.DESCRIPTION
Automate the Change Assistant job that applies the PTU856 project to a database.
.PARAMETER DATABASE
Which database to encrypt the password
.PARAMETER PT_VERSION
PeopleTools version to apply
.PARAMETER CA_BASE
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//