High Performance Computing Introduction to Unix - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

High Performance Computing Introduction to Unix

Description:

High Performance Computing Introduction to Unix. Robert Whitten Jr ... elif [ $1 = 'howdy' ]; then. echo howdy to you too. else. echo nobody home. fi ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 14
Provided by: nccs9
Category:

less

Transcript and Presenter's Notes

Title: High Performance Computing Introduction to Unix


1
High Performance Computing Introduction to Unix
  • Robert Whitten Jr

2
Welcome!
  • Todays Agenda
  • Questions from last week
  • File systems
  • Shell scripting

3
From last time
  • Send me that email if you havent already
  • whittenrm1_at_ornl.gov
  • Apply for an account
  • http//www.nccs.gov/user-support/access/account-re
    quest/
  • Download and install cygwin (Windows users only)
  • Download putty.exe (Windows users only)

4
Shell scripts
  • Programs to help automate recurring task
  • Text files that are interpreted by shell program
  • Interpreted vs compiled languages

5
Shell script basics
  • Comments
  • Values
  • Variables
  • Arrays
  • Selection
  • Loops

6
Shell script - comments
  • Comments are not executed
  • Useful in documenting you scripts
  • comment everything to right
  • Exception is very first line of script
  • !/bin/bash

7
Shell script - values
  • Values are object used in your script
  • String values bobby
  • Numerical values 94
  • String values are quoted
  • bobby just a string, no processing
  • bobby a string, but with processing
  • bobby - execute this string and get output back
  • Numerical values can have math performed on them
    using the special form (( ))
  • x((22))
  • echo x
  • 4

8
Shell script - variables
  • Use variables when the values may change
  • Example
  • xhello
  • echo x
  • hello
  • x5
  • echo x
  • 5
  • If you want to treat a string as a variable
  • let x55

9
Shell scripts - arrays
  • Arrays are variable with 1 or more elements
  • x(a b c d)
  • echo x0
  • a
  • echo x
  • a
  • Wheres everything else?
  • echo x_at_
  • a b c d

10
Shell scripts - selection
  • If this, then that, else something else
  • if then elif fi
  • !/bin/bash
  • if 1 'hello'
  • then
  • echo hello yourself
  • elif 1 'howdy'
  • then
  • echo howdy to you too
  • else
  • echo nobody home
  • fi

11
Shell script - loops
  • For this number of times, do something
  • for name in bobby doug frank do
  • echo name
  • done
  • let x1
  • until x -eq 10 do
  • echo x
  • let xx1
  • done
  • let x1
  • while x -ne 10 do
  • echo x
  • let xx1
  • done

12
Homework
  • Send an email to me if you havent
  • whittenrm1_at_ornl.gov
  • Homework 1 will be posted soon to website
  • Make sure cygwin is installed and working
    (Windows)
  • Make sure you can get to a terminal window (Mac)

13
Questions?
http//www.nccs.gov
Oak Ridge National Laboratory
U. S. Department Of Energy 13
Write a Comment
User Comments (0)
About PowerShow.com