Lab 5a Shell Script Lab 4 Using Arithmetic Operators in shell script

Size: px
Start display at page:

Download "Lab 5a Shell Script Lab 4 Using Arithmetic Operators in shell script"

Transcription

1 Lab 5a Shell Script Lab 4 Using Arithmetic Operators in shell script Objective Upon completion of this lab, the student will be able to use arithmetic operators in Linux shell script. Scenario The student is the administrator of a Linux server who wants to use arithmetic operators to in a simple shell script. Procedures Login into Fedora operating system. Use a text editor such as gedit, vi or emacs. Write required Linux commands and logic in the le. Save and close the le (exit from gedit, vi or emacs). Make the script executable. Test the script by running it, and verify the output. Step 1: Creating the Script 1.1 Login into Fedora operating system. 1.2 Launch gedit Text Editor by clicking on Applications Accessories gedit Text Editor 1.3 Type in the following using gedit text editor: x=1 y=2 ans=$(( x + y )) echo "$x + $y = $ans" 1.4 Save the text as addup.sh. 1.5 Go to terminal by click on Application System Tools Terminal 1.6 Make the le executable and run the script by typing the following commands in the terminal. chmod +x addup.sh./ addup.sh = 3 Instructor Signature 1

2 Step 2: Add in read command in the script. 2.1 Open the le addup.sh using gedit text editor. 2.2 Modify the code as follow: echo Enter rst number: read x echo Enter second number: read y ans=$(( x * y )) echo "$x * $y = $ans" 2.3 Save the text and run the script by typing the following commands in the terminal../addup.sh Enter rst number: 1 Enter second number: = 3 2.4) Write down a script that will prompt three integers value from user. The script will add up all the three integers and displays the total. Show your instructor the nal output of the script. Instructor Signature 2

3 Lab 5b Shell Script Lab 5 Using if conditional statements in shell script Objective Upon completion of this lab, the student will be able to use if conditional statement in Linux shell script. Scenario The student is the administrator of a Linux server who wants to create a simple shell script using if condition statement. Procedures Login into Fedora operating system. Use a text editor such as gedit, vi or emacs. Write required Linux commands and logic in the le. Save and close the le (exit from gedit, vi or emacs). Make the script executable. Test the script by running it, and verify the output. Step 1: Creating the Script 1.1 Login into Fedora operating system. 1.2 Launch gedit Text Editor by clicking on Applications Accessories gedit Text Editor 1.3 Type in the following using gedit text editor: number1=10 number2=8 if test $number1>$number2 1.4 Save the text as twonumbers.sh. 1.5 Go to terminal by clicking on Application System Tools Terminal 1.6 Make the le executable and run the script by typing the following commands in the terminal. 3

4 10 is greater than 8. Since $number1 (10) is greater than $number2 (8), the test statement will return a true, hence the echo statement will be executed. Step 2: Adding an else statement. 1.1 Open the le twonumbers.sh using gedit text editor. 1.2 Modify the code as follow: number1=6 number2=12 if test $number1 gt $number2 else echo $number2 is greater than $number Save the text and run the script by typing the following commands in the terminal. 12 is greater than 6. Since $number1 (6) is not greater than $number2 (12), the test statement will return a false, hence the echo statement under else will be executed. Step 3: Adding read statements in the script. 1.1 Open the le myname.sh using gedit text editor. 1.2 Modify the code as follow: read number1 read number2 if test $number1 gt $number2 else echo $number2 is greater than $number1. 4

5 1.3 Save the text and run the script by typing the following commands in the terminal. 1.4 Enter two numbers in the terminal is greater than 3. The read statement will take in numbers entered by the user. After taking two numbers, the script will echo the correct message based on the if and else statements. 1.5) Write down a script that takes in two numbers from the users. If the two numbers are the same, the script will echo These two numbers are the same. If the two numbers are different, the script will echo These two numbers are different. Show the output to your instructor Instructor Signature 5

Using echo command in shell script

Using echo command in shell script Lab 4a Shell Script Lab 2 Using echo command in shell script Objective Upon completion of this lab, the student will be able to use echo command in the shell script. Scenario The student is the administrator

More information

Lab 3a Using the vi editor

Lab 3a Using the vi editor Lab 3a Using the vi editor Objectives: Become familiar with the vi Editor Review the three vi Modes Review keystrokes to move between vi modes Create a new file with vi Editor Invoke vi with show mode

More information

Shell programming. Introduction to Operating Systems

Shell programming. Introduction to Operating Systems Shell programming Introduction to Operating Systems Environment variables Predened variables $* all parameters $# number of parameters $? result of last command $$ process identier $i parameter number

More information

Shell Script Programs with If Then Else Statements

Shell Script Programs with If Then Else Statements Shell Script Programs with If Then Else Statements June 3, 2010 Copyright 2010 by World Class CAD, LLC. All Rights Reserved. Adding Comments When we want to place a comment in a Shell Script, we type the

More information

15-122: Principles of Imperative Computation

15-122: Principles of Imperative Computation 15-122: Principles of Imperative Computation Lab 0 Navigating your account in Linux Tom Cortina, Rob Simmons Unlike typical graphical interfaces for operating systems, here you are entering commands directly

More information

INd_rasN SOME SHELL SCRIPTING PROGRAMS. 1. Write a shell script to check whether the name passed as first argument is the name of a file or directory.

INd_rasN SOME SHELL SCRIPTING PROGRAMS. 1. Write a shell script to check whether the name passed as first argument is the name of a file or directory. 1. Write a shell script to check whether the name passed as rst argument is the name of a le or directory. Ans: #!/bin/bash if [ -f $1 ] echo "$1 is a le" echo "$1 is not a le" 2. Write a shell script

More information

Shell scripting and system variables. HORT Lecture 5 Instructor: Kranthi Varala

Shell scripting and system variables. HORT Lecture 5 Instructor: Kranthi Varala Shell scripting and system variables HORT 59000 Lecture 5 Instructor: Kranthi Varala Text editors Programs built to assist creation and manipulation of text files, typically scripts. nano : easy-to-learn,

More information

Lab #12: Shell Scripting

Lab #12: Shell Scripting Lab #12 Page 1 of 11 Lab #12: Shell Scripting Students will familiarize themselves with UNIX shell scripting using basic commands to manipulate the le system. Part A Instructions: This part will be demonstrated

More information

OPERATING SYSTEMS LAB LAB # 6. I/O Redirection and Shell Programming. Shell Programming( I/O Redirection and if-else Statement)

OPERATING SYSTEMS LAB LAB # 6. I/O Redirection and Shell Programming. Shell Programming( I/O Redirection and if-else Statement) P a g e 1 OPERATING SYSTEMS LAB LAB 6 I/O Redirection and Shell Programming Lab 6 Shell Programming( I/O Redirection and if-else Statement) P a g e 2 Redirection of Standard output/input i.e. Input - Output

More information

CSCI 211 UNIX Lab. Shell Programming. Dr. Jiang Li. Jiang Li, Ph.D. Department of Computer Science

CSCI 211 UNIX Lab. Shell Programming. Dr. Jiang Li. Jiang Li, Ph.D. Department of Computer Science CSCI 211 UNIX Lab Shell Programming Dr. Jiang Li Why Shell Scripting Saves a lot of typing A shell script can run many commands at once A shell script can repeatedly run commands Help avoid mistakes Once

More information

Vi & Shell Scripting

Vi & Shell Scripting Vi & Shell Scripting Comp-206 : Introduction to Week 3 Joseph Vybihal Computer Science McGill University Announcements Sina Meraji's office hours Trottier 3rd floor open area Tuesday 1:30 2:30 PM Thursday

More information

Linux Shell Script. J. K. Mandal

Linux Shell Script. J. K. Mandal Linux Shell Script J. K. Mandal Professor, Department of Computer Science & Engineering, Faculty of Engineering, Technology & Management University of Kalyani Kalyani, Nadia, West Bengal E-mail: jkmandal@klyuniv.ac.in,

More information

Bourne Shell Reference

Bourne Shell Reference > Linux Reviews > Beginners: Learn Linux > Bourne Shell Reference Bourne Shell Reference found at Br. David Carlson, O.S.B. pages, cis.stvincent.edu/carlsond/cs330/unix/bshellref - Converted to txt2tags

More information

28-Nov CSCI 2132 Software Development Lecture 33: Shell Scripting. 26 Shell Scripting. Faculty of Computer Science, Dalhousie University

28-Nov CSCI 2132 Software Development Lecture 33: Shell Scripting. 26 Shell Scripting. Faculty of Computer Science, Dalhousie University Lecture 33 p.1 Faculty of Computer Science, Dalhousie University CSCI 2132 Software Development Lecture 33: Shell Scripting 28-Nov-2018 Location: Chemistry 125 Time: 12:35 13:25 Instructor: Vla Keselj

More information

Scripting. More Shell Scripts. Adapted from Practical Unix and Programming Hunter College

Scripting. More Shell Scripts. Adapted from Practical Unix and Programming Hunter College Scripting More Shell Scripts Adapted from Practical Unix and Programming Hunter College Copyright 2006 2009 Stewart Weiss Back to shell scripts Now that you've learned a few commands and can edit files,

More information

Grep and Shell Programming

Grep and Shell Programming Grep and Shell Programming Comp-206 : Introduction to Software Systems Lecture 7 Alexandre Denault Computer Science McGill University Fall 2006 Teacher's Assistants Michael Hawker Monday, 14h30 to 16h30

More information

What is Bash Shell Scripting?

What is Bash Shell Scripting? What is Bash Shell Scripting? A shell script is a script written for the shell, or command line interpreter, of an operating system. The shell is often considered a simple domain-specic programming language.

More information

CS CS Tutorial 2 2 Winter 2018

CS CS Tutorial 2 2 Winter 2018 CS CS 230 - Tutorial 2 2 Winter 2018 Sections 1. Unix Basics and connecting to CS environment 2. MIPS Introduction & CS230 Interface 3. Connecting Remotely If you haven t set up a CS environment password,

More information

Practical 04: UNIX / LINUX Shell Programming 1

Practical 04: UNIX / LINUX Shell Programming 1 Operating Systems: UNIX / LINUX Shell Programming 1 Page 1 Practical 04: UNIX / LINUX Shell Programming 1 Name: Roll no: Date: Section: Practical Objectives 1. To study about the Unix Shell Programming

More information

Bash scripting basics

Bash scripting basics Bash scripting basics prepared by Anatoliy Antonov for ESSReS community September 2012 1 Outline Definitions Foundations Flow control References and exercises 2 Definitions 3 Definitions Script - [small]

More information

COMP 4/6262: Programming UNIX

COMP 4/6262: Programming UNIX COMP 4/6262: Programming UNIX Lecture 12 shells, shell programming: passing arguments, if, debug March 13, 2006 Outline shells shell programming passing arguments (KW Ch.7) exit status if (KW Ch.8) test

More information

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words More Linux Commands 1 wc The Linux command for acquiring size statistics on a file is wc. This command provides the line count, word count and number of bytes in a file. Open up a terminal, make sure you

More information

CS1101: Lecture 9 The Shell as a Programming Language

CS1101: Lecture 9 The Shell as a Programming Language CS1101: Lecture 9 The Shell as a Programming Language Dr. Barry O Sullivan b.osullivan@cs.ucc.ie Counting Arguments Using read Lecture Outline Arithmetic using expr Course Homepage http://www.cs.ucc.ie/

More information

Week 6 Lesson 1: Control-Flow Statements (Continued)

Week 6 Lesson 1: Control-Flow Statements (Continued) Week 6 Lesson 1: Control-Flow Statements (Continued) 1 Chapter Objectives In this chapter, you will: Learn additional shell scripting tools including: Logic Case Statement Loops Purpose Indeterminate Loops

More information

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017 Einführung in die Programmierung für Physiker WS 207/208 Marc Wagner Francesca Cuteri: cuteri@th.physik.uni-frankfurt.de Alessandro Sciarra: sciarra@th.physik.uni-frankfurt.de Exercise sheet To be corrected

More information

Checking Resource Usage in Fedora (Linux)

Checking Resource Usage in Fedora (Linux) Lab 5C Checking Resource Usage in Fedora (Linux) Objective In this exercise, the student will learn how to check the resources on a Fedora system. This lab covers the following commands: df du top Equipment

More information

The Unix Shell & Shell Scripts

The Unix Shell & Shell Scripts The Unix Shell & Shell Scripts You should do steps 1 to 7 before going to the lab. Use the Linux system you installed in the previous lab. In the lab do step 8, the TA may give you additional exercises

More information

Open up a terminal, make sure you are in your home directory, and run the command.

Open up a terminal, make sure you are in your home directory, and run the command. More Linux Commands 0.1 wc The Linux command for acquiring size statistics on a file is wc. This command can provide information from line count, to bytes in a file. Open up a terminal, make sure you are

More information

More Raspian. An editor Configuration files Shell scripts Shell variables System admin

More Raspian. An editor Configuration files Shell scripts Shell variables System admin More Raspian An editor Configuration files Shell scripts Shell variables System admin Nano, a simple editor Nano does not require the mouse. You must use your keyboard to move around the file and make

More information

example: name1=jan name2=mike export name1 In this example, name1 is an environmental variable while name2 is a local variable.

example: name1=jan name2=mike export name1 In this example, name1 is an environmental variable while name2 is a local variable. Bourne Shell Programming Variables - creating and assigning variables Bourne shell use the set and unset to create and assign values to variables or typing the variable name, an equal sign and the value

More information

Shell script. Shell Scripts. A shell script contains a sequence of commands in a text file. Shell is an command language interpreter.

Shell script. Shell Scripts. A shell script contains a sequence of commands in a text file. Shell is an command language interpreter. Shell Scripts A shell script contains a sequence of commands in a text file. Shell is an command language interpreter. Shell executes commands read from a file. Shell is a powerful programming available

More information

INTRODUCTION TO UNIX

INTRODUCTION TO UNIX WEEK 1.3 INTRODUCTION TO UNIX Unix is a key operating system in the history of communications. Here, you will gain experience in using Unix both in command line and with a graphical interface. Most importantly,

More information

Shell Scripting. Todd Kelley CST8207 Todd Kelley 1

Shell Scripting. Todd Kelley CST8207 Todd Kelley 1 Shell Scripting Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 If we have a set of commands that we want to run on a regular basis, we could write a script A script acts as a Linux command,

More information

Prof. Navrati Saxena TA: R. Sachan Bharat Jyoti Ranjan

Prof. Navrati Saxena TA: R. Sachan Bharat Jyoti Ranjan Prof. Navrati Saxena navrati@ece.skku.ac.kr TA: R. Sachan rochak@skku.edu Bharat Jyoti Ranjan Decision making Loops de-bugging the shell script 2 What is decision.? How to take decision? Knows only 0(zero)

More information

Lab 1 : An Introduction to SPIM, the MIPS architecture simulator

Lab 1 : An Introduction to SPIM, the MIPS architecture simulator Lab 1 : An Introduction to SPIM, the MIPS architecture simulator Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work 1

More information

LAB 1 INTRODUCTION TO LINUX ENVIRONMENT AND C COMPILER

LAB 1 INTRODUCTION TO LINUX ENVIRONMENT AND C COMPILER LAB 1 INTRODUCTION TO LINUX ENVIRONMENT AND C COMPILER School of Computer and Communication Engineering Universiti Malaysia Perlis 1 1. GETTING STARTED: 1.1 Steps to Create New Folder: 1.1.1 Click Places

More information

Computer Systems and Architecture

Computer Systems and Architecture Computer Systems and Architecture Stephen Pauwels UNIX Scripting Academic Year 2018-2019 Outline Basics Conditionals Loops Advanced Exercises Shell Scripts Grouping commands into a single file Reusability

More information

CSC 2500: Unix Lab Fall 2016

CSC 2500: Unix Lab Fall 2016 CSC 2500: Unix Lab Fall 2016 Control Statements in Shell Scripts: Decision Mohammad Ashiqur Rahman Department of Computer Science College of Engineering Tennessee Tech University Agenda User Input Special

More information

Essentials for Scientific Computing: Bash Shell Scripting Day 3

Essentials for Scientific Computing: Bash Shell Scripting Day 3 Essentials for Scientific Computing: Bash Shell Scripting Day 3 Ershaad Ahamed TUE-CMS, JNCASR May 2012 1 Introduction In the previous sessions, you have been using basic commands in the shell. The bash

More information

SHELL SCRIPT BASIC. UNIX Programming 2014 Fall by Euiseong Seo

SHELL SCRIPT BASIC. UNIX Programming 2014 Fall by Euiseong Seo SHELL SCRIPT BASIC UNIX Programming 2014 Fall by Euiseong Seo Shell Script Interactive shell sequentially executes a series of commands Some tasks are repetitive and automatable They are what programs

More information

Linux Systems Administration Shell Scripting Basics. Mike Jager Network Startup Resource Center

Linux Systems Administration Shell Scripting Basics. Mike Jager Network Startup Resource Center Linux Systems Administration Shell Scripting Basics Mike Jager Network Startup Resource Center mike.jager@synack.co.nz These materials are licensed under the Creative Commons Attribution-NonCommercial

More information

Linux at the Command Line Don Johnson of BU IS&T

Linux at the Command Line Don Johnson of BU IS&T Linux at the Command Line Don Johnson of BU IS&T We ll start with a sign in sheet. We ll end with a class evaluation. We ll cover as much as we can in the time allowed; if we don t cover everything, you

More information

Configuring the Raspberry Pi for the UPS

Configuring the Raspberry Pi for the UPS Conguring the Raspberry Pi for the UPS To enable to Raspberry Pi to detect the presence of the UPS and to enable it to shut itself and the UPS down in an orderly fashion changes have to be made to the

More information

SHELL SCRIPT BASIC. UNIX Programming 2015 Fall by Euiseong Seo

SHELL SCRIPT BASIC. UNIX Programming 2015 Fall by Euiseong Seo SHELL SCRIPT BASIC UNIX Programming 2015 Fall by Euiseong Seo Shell Script! Interactive shell sequentially executes a series of commands! Some tasks are repetitive and automatable! They are what programs

More information

A shell can be used in one of two ways:

A shell can be used in one of two ways: Shell Scripting 1 A shell can be used in one of two ways: A command interpreter, used interactively A programming language, to write shell scripts (your own custom commands) 2 If we have a set of commands

More information

Linux Shell Scripting. Linux System Administration COMP2018 Summer 2017

Linux Shell Scripting. Linux System Administration COMP2018 Summer 2017 Linux Shell Scripting Linux System Administration COMP2018 Summer 2017 What is Scripting? Commands can be given to a computer by entering them into a command interpreter program, commonly called a shell

More information

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers A Big Step Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Copyright 2006 2009 Stewart Weiss What a shell really does Here is the scoop on shells. A shell is a program

More information

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Scripting Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers Adapted from Practical Unix and Programming Hunter College Copyright 2006 2009 Stewart Weiss What a shell

More information

University of Windsor : System Programming Winter Midterm 01-1h20mn. Instructor: Dr. A. Habed

University of Windsor : System Programming Winter Midterm 01-1h20mn. Instructor: Dr. A. Habed University of Windsor 0360-256: System Programming Winter 2007 - Midterm 01-1h20mn. Instructor: Dr. A. Habed Solution Last name: First name: Student #: NONE NONE NONE Read this first Make sure your paper

More information

Linux Exercise. pwd answer: We call this directory (into which you get when you log in) your home directory.

Linux Exercise. pwd answer: We call this directory (into which you get when you log in) your home directory. Linux Exercise The following steps will guide you through the most common Linux commands. If you are using windows (Library and any Windows lab on campus), then start with step 1. If you are using a linux

More information

Title:[ Variables Comparison Operators If Else Statements ]

Title:[ Variables Comparison Operators If Else Statements ] [Color Codes] Environmental Variables: PATH What is path? PATH=$PATH:/MyFolder/YourStuff?Scripts ENV HOME PWD SHELL PS1 EDITOR Showing default text editor #!/bin/bash a=375 hello=$a #No space permitted

More information

Compiling C/C++ programs

Compiling C/C++ programs Name: Student ID: Lab Instructor: Borja Sotomayor Do not write in this area 1 2 3 TOTAL Maximum possible points: 20 + 2 NOTE: The lab session will take place in the Linux machines of the Maclab. This lab

More information

CS Fundamentals of Programming II Fall Very Basic UNIX

CS Fundamentals of Programming II Fall Very Basic UNIX CS 215 - Fundamentals of Programming II Fall 2012 - Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the CS (Project) Lab (KC-265)

More information

CS 112: Intro to Comp Prog

CS 112: Intro to Comp Prog CS 112: Intro to Comp Prog Importing modules Branching Loops Program Planning Arithmetic Program Lab Assignment #2 Upcoming Assignment #1 Solution CODE: # lab1.py # Student Name: John Noname # Assignment:

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB MATLAB stands for MATrix LABoratory. Originally written by Cleve Moler for college linear algebra courses, MATLAB has evolved into the premier software for linear algebra computations

More information

Traditional Access Permissions

Traditional Access Permissions Traditional Access Permissions There are three types of users: - owner - group - other (aka world) A user may attempt to access an ordinary file in three ways: - read from - write to - execute Use ls l

More information

9.2 Linux Essentials Exam Objectives

9.2 Linux Essentials Exam Objectives 9.2 Linux Essentials Exam Objectives This chapter will cover the topics for the following Linux Essentials exam objectives: Topic 3: The Power of the Command Line (weight: 10) 3.3: Turning Commands into

More information

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu)

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu) I. INTERACTIVE MODE VERSUS SCRIPT MODE There are two ways to use the python interpreter: interactive mode and script mode. 1. Interactive Mode (a) open a terminal shell (terminal emulator in Applications

More information

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2 Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades 2017-2018 Q2 Facultat d Informàtica de Barcelona This first lab session is focused on getting experience in working

More information

More Linux Shell Scripts

More Linux Shell Scripts nit 5 ore Linux hell cripts opics for this nit ore shell commands Control statements Constraints xpressions elect command Case command unning hell cripts shell script as a standalone is an executable program

More information

Traditional Access Permissions

Traditional Access Permissions Traditional Access Permissions There are three types of users: - owner - group - other (aka world) A user may attempt to access an ordinary file in three ways: - read from - write to - execute Use ls lto

More information

Getting started with Hugs on Linux

Getting started with Hugs on Linux Getting started with Hugs on Linux COM1022 Functional Programming Techniques Dr Hans Georg Schaathun University of Surrey Autumn 2009 Week 7 Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn

More information

Shell Programming (ch 10)

Shell Programming (ch 10) Vim Commands vim filename Shell Programming (ch 10) IT244 - Introduction to Linux / Unix Instructor: Bo Sheng Add contents: i/a Back to command mode: ESC Save the file: :w Delete: x Quit: :q 1 2 The order

More information

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu)

There are two ways to use the python interpreter: interactive mode and script mode. (a) open a terminal shell (terminal emulator in Applications Menu) I. INTERACTIVE MODE VERSUS SCRIPT MODE There are two ways to use the python interpreter: interactive mode and script mode. 1. Interactive Mode (a) open a terminal shell (terminal emulator in Applications

More information

Flow Control: Branches and loops

Flow Control: Branches and loops Flow Control: Branches and loops In this context flow control refers to controlling the flow of the execution of your program that is, which instructions will get carried out and in what order. In the

More information

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the EECS labs that dual boot

More information

LING 408/508: Computational Techniques for Linguists. Lecture 5

LING 408/508: Computational Techniques for Linguists. Lecture 5 LING 408/508: Computational Techniques for Linguists Lecture 5 Last Time Installing Ubuntu 18.04 LTS on top of VirtualBox Your Homework 2: did everyone succeed? Ubuntu VirtualBox Host OS: MacOS or Windows

More information

Basic Linux (Bash) Commands

Basic Linux (Bash) Commands Basic Linux (Bash) Commands Hint: Run commands in the emacs shell (emacs -nw, then M-x shell) instead of the terminal. It eases searching for and revising commands and navigating and copying-and-pasting

More information

Some Linux (Unix) Commands that might help you in ENSC351

Some Linux (Unix) Commands that might help you in ENSC351 Some Linux (Unix) Commands that might help you in ENSC351 First, like Windows, Linux and Unix (for our purposes, they are the basically the same) use a hierarchical directory structure. What would be called

More information

Shell Script Programming

Shell Script Programming C h a p t e r 5 Programming In this chapter, you will learn the following to World Class standards: 1. s 2. Variables 3. Operations 4. Creating an Executable 5-1 Introduction to s A shell script is a text

More information

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1 Review of Fundamentals Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 The CST8207 course notes GPL the shell SSH (secure shell) the Course Linux Server RTFM vi general shell review 2 Linux

More information

How to Use This Lab Manual

How to Use This Lab Manual 3 Contents How to Use This Lab Manual........................................ 5 Lab 1: Setting Up the Student System.................................. 7 Lab 2: Installing Fedora............................................

More information

Saint Louis University. Intro to Linux and C. CSCI 2400/ ECE 3217: Computer Architecture. Instructors: David Ferry

Saint Louis University. Intro to Linux and C. CSCI 2400/ ECE 3217: Computer Architecture. Instructors: David Ferry Intro to Linux and C CSCI 2400/ ECE 3217: Computer Architecture Instructors: David Ferry 1 Overview Linux C Hello program in C Compiling 2 History of Linux Way back in the day: Bell Labs Unix Widely available

More information

Review of Fundamentals

Review of Fundamentals Review of Fundamentals 1 The shell vi General shell review 2 http://teaching.idallen.com/cst8207/14f/notes/120_shell_basics.html The shell is a program that is executed for us automatically when we log

More information

Jackson State University Department of Computer Science CSC / Computer Security Fall 2013 Instructor: Dr. Natarajan Meghanathan

Jackson State University Department of Computer Science CSC / Computer Security Fall 2013 Instructor: Dr. Natarajan Meghanathan Jackson State University Department of Computer Science CSC 437-01/539-01 Computer Security Fall 2013 Instructor: Dr. Natarajan Meghanathan Lab Project # 2: Running Secure Shell (SSH) Server in a Virtual

More information

AMS 200: Working on Linux/Unix Machines

AMS 200: Working on Linux/Unix Machines AMS 200, Oct 20, 2014 AMS 200: Working on Linux/Unix Machines Profs. Nic Brummell (brummell@soe.ucsc.edu) & Dongwook Lee (dlee79@ucsc.edu) Department of Applied Mathematics and Statistics University of

More information

CS1600 Lab Assignment 1 Spring 2016 Due: Feb. 2, 2016 POINTS: 10

CS1600 Lab Assignment 1 Spring 2016 Due: Feb. 2, 2016 POINTS: 10 CS1600 Lab Assignment 1 Spring 2016 Due: Feb. 2, 2016 POINTS: 10 PURPOSE: The purpose of this lab is to acquaint you with the C++ programming environment on storm. PROCEDURES: You will use Unix/Linux environment

More information

Csci 132 Spring 13. Assignment 2 Due: Tuesday, March 5 (by 11:59PM)

Csci 132 Spring 13. Assignment 2 Due: Tuesday, March 5 (by 11:59PM) Csci 132 Spring 13 Assignment 2 Due: Tuesday, March 5 (by 11:59PM) A. Readings Read and understand this part before starting working on the exercises of part B. Variables In a Bash script a variable can

More information

Student Registration Instructions

Student Registration Instructions Student Registration Instructions Before you begin, you will need a 10-character Class Code and a 20-character ALEKS Access Code. If you do not have an access code, you can purchase one during this registration

More information

Global-Net 2.0d Quick Installation

Global-Net 2.0d Quick Installation Global-Net 2.0d Quick Installation 1. Install Global-Net 1.1 Windows Copy Global-Net_2.0d.zip to your disk. (Ex. C:\) Extract the file and open the directory Global-Net_2.0d. Double-click launch.exe 1.2

More information

Temple University Computer Science Programming Under the Linux Operating System January 2017

Temple University Computer Science Programming Under the Linux Operating System January 2017 Temple University Computer Science Programming Under the Linux Operating System January 2017 Here are the Linux commands you need to know to get started with Lab 1, and all subsequent labs as well. These

More information

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p. Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p. 2 Conventions Used in This Book p. 2 Introduction to UNIX p. 5 An Overview

More information

Computer Systems and Architecture

Computer Systems and Architecture Computer Systems and Architecture UNIX Scripting Bart Meyers University of Antwerp August 29, 2012 Outline Basics Conditionals Loops Advanced Exercises Shell scripts Grouping commands into a single file

More information

Practical Computing-II. Programming in the Linux Environment. 0. An Introduction. B.W.Gore. March 20, 2015

Practical Computing-II. Programming in the Linux Environment. 0. An Introduction. B.W.Gore. March 20, 2015 Practical Computing-II March 20, 2015 0. An Introduction About The Course CMS M.2.2 Practical Computing-II About The Course CMS M.2.2 Practical Computing-II 25 credits (33.33% weighting) About The Course

More information

Lecture 5. Essential skills for bioinformatics: Unix/Linux

Lecture 5. Essential skills for bioinformatics: Unix/Linux Lecture 5 Essential skills for bioinformatics: Unix/Linux UNIX DATA TOOLS Text processing with awk We have illustrated two ways awk can come in handy: Filtering data using rules that can combine regular

More information

Linux shell & shell scripting - II

Linux shell & shell scripting - II IBS 574 - Computational Biology & Bioinformatics Spring 2018, Tuesday (02/01), 2:00-4:00PM Linux shell & shell scripting - II Ashok R. Dinasarapu Ph.D Scientist, Bioinformatics Dept. of Human Genetics,

More information

Introduction to Joker Cyber Infrastructure Architecture Team CIA.NMSU.EDU

Introduction to Joker Cyber Infrastructure Architecture Team CIA.NMSU.EDU Introduction to Joker Cyber Infrastructure Architecture Team CIA.NMSU.EDU What is Joker? NMSU s supercomputer. 238 core computer cluster. Intel E-5 Xeon CPUs and Nvidia K-40 GPUs. InfiniBand innerconnect.

More information

Bash Programming. Student Workbook

Bash Programming. Student Workbook Student Workbook Bash Programming Published by ITCourseware, LLC, 7245 South Havana Street, Suite 100, Englewood, CO 80112 Contributing Authors: Julie Johnson, Rob Roselius Editor: Jeff Howell Special

More information

ITEC451 Network Design & Analysis Laboratory Guide: Appendix

ITEC451 Network Design & Analysis Laboratory Guide: Appendix Linux Guide Accessing the command prompt Before you can access the command prompt, you must login to the system. The administrative user on Linux machines is named root. On most Linux distributions, you

More information

NoMachine NX Client Configuration Guide

NoMachine NX Client Configuration Guide NoMachine NX Client Configuration Guide Configuration steps for ssh key login Step 1: NoMachine NX requires keys in OpenSSH format, therefore the existing key needs to be converted into OpenSSH format.

More information

Lab 6 : Introduction to Verilog

Lab 6 : Introduction to Verilog Lab 6 : Introduction to Verilog Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work 1 Objective The main objective of

More information

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors CSE 391 Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller and Ruth Anderson http://www.cs.washington.edu/391/

More information

CS Unix Tools & Scripting

CS Unix Tools & Scripting Cornell University, Spring 2014 1 February 24, 2014 1 Slides evolved from previous versions by Hussam Abu-Libdeh and David Slater A note on awk for (item in array) The order in which items are returned

More information

Scripting. More Shell Scripts Loops. Adapted from Practical Unix and Programming Hunter College

Scripting. More Shell Scripts Loops. Adapted from Practical Unix and Programming Hunter College Scripting More Shell Scripts Loops Adapted from Practical Unix and Programming Hunter College Copyright 2006 2009 Stewart Weiss Loops: for The for script version 1: 1 #!/bin/bash 2 for i in 1 2 3 3 do

More information

Shell Programming (bash)

Shell Programming (bash) Shell Programming Shell Programming (bash) Commands run from a file in a subshell A great way to automate a repeated sequence of commands. File starts with #!/bin/bash absolute path to the shell program

More information

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts CSCI 2132 Software Development Lecture 3: Unix Shells and Other Basic Concepts Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 10-Sep-2018 (3) CSCI 2132 1 Introduction to UNIX

More information

An Introduction to MATLAB

An Introduction to MATLAB An Introduction to MATLAB Day 1 Simon Mitchell Simon.Mitchell@ucla.edu High level language Programing language and development environment Built-in development tools Numerical manipulation Plotting of

More information

LAB 11: METHODS. CPCS The Lab Note Lab 11 Page 1. Statement Purpose:

LAB 11: METHODS. CPCS The Lab Note Lab 11 Page 1. Statement Purpose: Statement Purpose: The purpose of this Lab. is to practically familiarize student with how to write the common code once and reuse it without rewriting it using the concept of Methods. Activity Outcomes:

More information

Lab of COMP 406. MATLAB: Quick Start. Lab tutor : Gene Yu Zhao Mailbox: or Lab 1: 11th Sep, 2013

Lab of COMP 406. MATLAB: Quick Start. Lab tutor : Gene Yu Zhao Mailbox: or Lab 1: 11th Sep, 2013 Lab of COMP 406 MATLAB: Quick Start Lab tutor : Gene Yu Zhao Mailbox: csyuzhao@comp.polyu.edu.hk or genexinvivian@gmail.com Lab 1: 11th Sep, 2013 1 Where is Matlab? Find the Matlab under the folder 1.

More information

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description: This course provides Bioinformatics students with the

More information