FIT3042 Final: Bash Scripting Cheat Sheet

55 views6 pages
Bash Scripting
How to run a .sh file
source filename.sh
sh file
#!/bin/bash on the top
Special Variables
Setting a Variable
myvar=Hello
myvar=’hello world’
Arithmetic
let
let a=5+4
Echo $a ( prints out 9)
expr
expr 5 + 4 output: 9
expr “5 + 4” output: 5 + 4
a=$( expr 10 - 3)
echo $a output: 7
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 6 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers