FreeKB - Bash (Scripting) articles
Bash (Scripting) articles

ArraysGetting Started with ArraysAppend values to an array (+=)Combining arraysCount values in an arraysort arrayunique arrayCommand Line Options and FlagsCommand line options flags arguments (case statement)shift command line optionscronCreate a crontab entry in bash scriptEmailSend a daily email (cron)FilesCreate Excel or CSV fileFunctionsGetting Started with functionsif elif else thenif, elif, else, then statementsIFS (Internal Field Separator)IFS (Internal Field Separator)JSONParse JSON (python)Loopsfor loopsMove onto next value in a loop (continue)select loopswhile loopsMathAddition and Increment (+)DivisionMultiplicationSubtractionPrintingprinting bold textRegular ExpressionsAdd a leading zero to single digit numbers in Linuxappend new lines to a file or variablecarriage returns (\r ^M)do something empty lines (sed)do something every nth matchdo something every other matchdo something first all or last matchdo something forward slashesdo something match does/doesn't begin with patterndo something match does/doesn't end with patterndo something pattern matchdo something range matchgrep previous or next matchinline text (paste command)newlines \nreplace string in fileReplacing whitespaceuppercase or lowercase (tr command)wildcard characterScript interpreterUnderstanding script interpreterSSHGetting Started with SSHVariablesappend values to a variable (+=)join lines in a variablejoin lines in different variableslocal and remote variables with SSHremove duplicate values from a variableremove new lines from a variablereplace values in a variable

Web design by yours truely - me, myself, and I   |   |