Site Tools


linux:scripts:basics

This is an old revision of the document!


Script

Commands

Command What it does
#!/bin/bash
or
#!/bin/sh
shebang
VAR=var set VAR to var
$VAR inserts var whereever $VAR is placed
case - esac inserts case
if - fi inserts fi

Troubleshooting

Interpreter error

Problem:
Running your script prompts interpreter error

Fix:
Open your script with vi and execute the following

 :set fileformat=unix 

Not enough rights

Problem:
Running your script requires more rights

Fix:
Make your script runable by executing the following code

chmod +x [scriptname].sh

linux/scripts/basics.1401975948.txt.gz · Last modified: 2017/03/01 12:50 (external edit)