User Tools

Site Tools


2018-08-25-meeting_bash_scripting

Differences

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

Link to this comparison view

2018-08-25-meeting_bash_scripting [2026/06/10 20:50] – created steve2018-08-25-meeting_bash_scripting [2026/06/10 20:56] (current) steve
Line 1: Line 1:
 ==== Meeting (Bash Scripting) ==== ==== Meeting (Bash Scripting) ====
 ** Steve Jones 2018-08-26**\\ ** Steve Jones 2018-08-26**\\
 +I ran this script as a presentation for this meeting - it's about bash, in bash, named Bashy.
 +
 +You can download it by clicking on the name at the top of the code window below.
 <code bash Bashy> <code bash Bashy>
 #!/bin/bash -i #!/bin/bash -i
Line 8: Line 11:
 # #
 # #
-# Steve Jones, for the 2008-04-26 meeting, CLUG.org+# Steve Jones, for the 2008-04-26 and 2018-08-26meeting, CLUG.org
 # Updates and information will be made available as quickly # Updates and information will be made available as quickly
 # as time permits. # as time permits.
    
 # Set the values for $LINES and $COLUMNS # Set the values for $LINES and $COLUMNS
-eval `resize # This runs a sub-shell, the output of which+eval $(resize # This runs a sub-shell, the output of which
  # is evaluated by the current shell.  # is evaluated by the current shell.
  
Line 240: Line 243:
 CodeOn CodeOn
 cat <<EOF | Format cat <<EOF | Format
-Users=\`cat <<-END+Users=\$(cat <<-END
  bill:1001:1001:Bill Smith:/home/bill:/bin/bash:\\\$1\\\$k0jwz7m2/mXNmL1  bill:1001:1001:Bill Smith:/home/bill:/bin/bash:\\\$1\\\$k0jwz7m2/mXNmL1
  jill:1002:1002:Jill Jones:/home/jill:/bin/bash:\\\$1\\\$k0jwz7m2/mXNmL1  jill:1002:1002:Jill Jones:/home/jill:/bin/bash:\\\$1\\\$k0jwz7m2/mXNmL1
Line 247: Line 250:
  mike:1005:1005:Mike Finck:/home/mike:/bin/bash:\\\$1\\\$k0jwz7m2/mXNmL1  mike:1005:1005:Mike Finck:/home/mike:/bin/bash:\\\$1\\\$k0jwz7m2/mXNmL1
  tina:1006:1006:Tina Waldo:/home/tina:/bin/bash:\\\$1\\\$k0jwz7m2/mXNmL1  tina:1006:1006:Tina Waldo:/home/tina:/bin/bash:\\\$1\\\$k0jwz7m2/mXNmL1
-END\`+END\)
 EOF EOF
 CodeOff CodeOff
Line 564: Line 567:
 Choose descriptive names for variables and functions. Choose descriptive names for variables and functions.
  
-    fl=\`ls -al \$dirname\                # Cryptic. +    fl=\$(ls -al \$dirname\                # Cryptic. 
-    file_listing=\`ls -al \$dirname\      # Better.+    file_listing=\$(ls -al \$dirname\      # Better.
  
  
2018-08-25-meeting_bash_scripting.txt · Last modified: by steve