User Tools

Site Tools


shellscript

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
shellscript [2025/01/19 03:22] 1211112228shellscript [2025/01/19 03:25] (current) 1211112228
Line 1: Line 1:
 ====== Shell Scripting ====== ====== Shell Scripting ======
-Execute shell script: ./script.shbash script.shsource script.sh+Execute shell script:  
 +  ./script.sh 
 +  bash script.sh 
 +  source script.sh
  
-Read user input: read+Read user input:  
 +  read
  
-Echo text to screen: echo+Echo text to screen:  
 +  echo
  
-Arithmetic operations: letexpr+Arithmetic operations:  
 +  let 
 +  expr
  
-Conditional statements: ifcase+Conditional statements:  
 +  if 
 +  case
  
-Loops: forwhile+Loops:  
 +  for 
 +  while
  
-Array operations: declareread -a+Array operations:  
 +  declare  
 +  read -a
  
-Check file/directory existence: -e-d-f+Check file/directory existence:  
 +  [file] -e  
 +  [file] -d  
 +  [file] -f
  
-Check file permissions: -r-w-x +Check file permissions:  
- +  [file] -r  
-Check file type: -b-c-L-S+  [file] -w  
 +  [file] -x 
 +   
 +Check file type:  
 +  [file] -b  
 +  [file] -c  
 +  [file] -L 
 +  [file] -S
shellscript.1737256951.txt.gz · Last modified: 2025/01/19 03:22 by 1211112228

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki