Site Tools


linux:scripts:basics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
linux:scripts:basics [2014/06/05 15:45] lunetikklinux:scripts:basics [2018/12/20 17:44] – Discussion status changed lunetikk
Line 3: Line 3:
 ===== Commands ===== ===== Commands =====
  
-^  Command  ^  What it does  ^+^  Command  ^  Function  ^
 |  #!/bin/bash\\ or\\ #!/bin/sh  |  shebang  | |  #!/bin/bash\\ or\\ #!/bin/sh  |  shebang  |
 |  VAR=var  |  set VAR to var  | |  VAR=var  |  set VAR to var  |
 |  $VAR  |  inserts var whereever $VAR is placed  | |  $VAR  |  inserts var whereever $VAR is placed  |
 |  case - esac  |  inserts case  | |  case - esac  |  inserts case  |
-|  if fi  |  inserts fi  |+|  if [ "var" == "var" ]; then fi  |  inserts if  |
  
 ===== Troubleshooting ===== ===== Troubleshooting =====
Line 14: Line 14:
 ==== Interpreter error ==== ==== Interpreter error ====
  
-Problem: \\+=== Problem: ===
 Running your script prompts interpreter error\\ Running your script prompts interpreter error\\
  
-Fix: \\+=== Fix: ===
 Open your script with vi and execute the following Open your script with vi and execute the following
 <code> :set fileformat=unix </code> <code> :set fileformat=unix </code>
Line 23: Line 23:
 ==== Not enough rights ==== ==== Not enough rights ====
  
-Problem: \\+=== Problem: ===
 Running your script requires more rights Running your script requires more rights
  
-Fix:\\ +=== Fix: === 
-Make your script runable by executing the following code+Make your script executable with the following command
 <code>chmod +x [scriptname].sh</code> <code>chmod +x [scriptname].sh</code>
 +\\ 
 +\\ 
 +~~DISCUSSION:closed~~
  
linux/scripts/basics.txt · Last modified: 2021/01/07 14:55 by lunetikk