Scripting Languages. Originally, a script was a file containing a sequence of commands that needed to be executed Control structures were added to make.

Slides:



Advertisements
Similar presentations
Social Web Design 1 Darby Chang Social Web Design.
Advertisements

Molecular Biomedical Informatics Web Programming 1.
A Guide to Unix Using Linux Fourth Edition
What is a scripting language? What is Python?
Server-Side vs. Client-Side Scripting Languages
Scripting Languages CS 351 – Programming Paradigms.
Scripting Languages CS351 – Programming Paradigms.
Perl Lecture #1 Scripting Languages Fall Perl Practical Extraction and Report Language -created by Larry Wall -- mid – 1980’s –needed a quick language.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Scripting with Ruby What is a scripting language? What is Ruby?
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
Advanced File Processing
Introduction to Perl Practical Extraction and Report Language or Pathologically Eclectic Rubbish Lister or …
Programming Languages – Primary Uses. FORTRAN, LISP, COBOL Supercomputing applications AI development Business software Fun Fact: The Terminator.
CENT 305 Information Systems Security Linux Introduction.
Python 0 Some material adapted from Upenn cmpe391 slides and other sources.
Computer Programming 12 Mr. Jean March 19 th, 2013.
CS 105 Perl: Course Introduction Nathan Clement 13 May 2014.
GNU Compiler Collection (GCC) and GNU C compiler (gcc) tools used to compile programs in Linux.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
Chapter Five Advanced File Processing Guide To UNIX Using Linux Fourth Edition Chapter 5 Unix (34 slides)1 CTEC 110.
Chapter Five Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command.
A very basic overview of Server-Side Scripting Or what is PHP, Perl, Python, Ruby and what can they do for me?
UNIX/LINUX SHELLS.  “A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Some content in this lecture added.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
Sed, awk, & perl CS 2204 Class meeting 13 *Notes by Mir Farooq Ali and other members of the CS faculty at Virginia Tech. Copyright 2003.
Intro to Python Adriane Huber Debbie Bartlett Python Lab #1Python Lab #1 1.
Introduction to Perl Yupu Liang cbio at MSKCC
1 Introduction to Perl CIS*2450 Advanced Programming Techniques.
Scripting Languages James Brucker Computer Engineering Dept Kasetsart University.
40 Years and Still Rocking the Terminal!
Scripting with Ruby What is a scripting language? What is Ruby?
Introduction to Python Origins Nature of Python Importance of Python Example.
Chapter Twelve sed, awk & perl1 System Programming sed, awk & perl.
TCL TK. Tcl/Tk C functions can become Tcl commands that are invoked interactively Tk = scriptable, portable user interface –Windows, X (Unix), MacOS,
Scripting with Ruby What is a scripting language? What is Ruby?
(the language for getting your job done) Internet Programming Diana Hingst.
Perl Lab #11 Intro to Perl Debbie Bartlett. Perl Lab #1 2 Perl Practical Extraction and Report Language –or- Pathologically Eclectic Rubbish Lister Created.
Copyright © 2009 Elsevier Chapter 13 :: Scripting Languages Programming Language Pragmatics Michael L. Scott.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
Scripting Languages Course 1 Diana Trandab ă ț Master in Computational Linguistics - 1 st year
Perl Ed Finegan. Overview of Pearl Perl is a high-level programming language written by Larry Wall. It derives from the C programming language and to.
Learning Unix/Linux Based on slides from: Eric Bishop.
Programming Languages Meeting 12 November 18/19, 2014.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Presented By P.SRIVIDYA 085D1A0552 Programming Language.
CSE 303 Concepts and Tools for Software Development Richard C. Davis UW CSE – 10/9/2006 Lecture 6 – String Processing.
Website Source Code Free Download.
Introduction to Perl: Practical extraction and report language
Unix Scripting Session 1 March 6, 2008.
CMIT100 Chapter 14 - Programming.
Bash Introduction (adapted from chapters 1 and 2 of bash Cookbook by Albing, Vossing, & Newham) CPTE 440 John Beckett.
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
NOCTI Study Guide #2.
PERL.
PERL.
Introduction to ASP By “FlyingBono” 2009_01 By FlyingBono 2009_01
Kevin Taylor.
Documentation Generators
The Linux Operating System
PHP / MySQL Introduction
Henning Schulzrinne Advanced Programming
Guide To UNIX Using Linux Third Edition
Perl Practical Extraction and Report Language
Presentation transcript:

Scripting Languages

Originally, a script was a file containing a sequence of commands that needed to be executed Control structures were added to make it possible to do more with scripts

Characteristics of Scripting Languages Generally interpreted Dynamic typing - no declarations Make text processing easy Often provide pattern matching for strings Provide file and directory manipulation Make it easy to do things quickly

Basic Scripting Languages Unix and Linux come with shell programs which are programmable –sh –bash –ksh –csh DOS had BAT files

Scripting in Other Environments Even with a GUI operating system, it is still useful to be able to automate repetetive tasks –Windows still has bat files –Mac OS has AppleScript Some applications have a scripting language built into them –Microsoft applications have Visual Basic for Applications (VBA) –Hypercard (Apple) had HyperTalk

Other Scripting Languages Other scripting languages were developed to provide increased capability –sed -- adapted from the unix ed editor in 1977 –AWK -- created by Ajo, Wienberger and Kernighan in 1977 –Tcl -- an extensible scripting language written by John Ousterhout in 1987 –Perl -- created by Larry Wall in 1986 –Python-- created in 1989 by Guido van Rossum –Ruby -- created in 1993 by Yukihiro Matsumoto

Scripting and the Web More recently, a number of scripting languages have been developed for use with web browsers –PHP –JavaScript –ASP (part of Microsoft.NET framework)

Scripting on onyx the shell command languages perl python ruby tcl

Scripts on onyx In the following, is the name of the interpreter (perl, python, ruby, tcl) create a file - a script whose first line is #!/usr/bin/ There are man pages for all of these man

Running Scripts two ways to run a program –give the name of file containing script to the interpreter prog –make script file executable and type the program name chmod +x script script./script

Hello World Perl #!/usr/bin/perl print "Hello, world!\n"; Python #!/usr/bin/python import sys sys.stdout.write("Hello world!\n")

Hello World Ruby #!/usr/bin/ruby print "Hello world!\n" Tcl #!/usr/bin/tcl puts "Hello world!"

Input Redirection In Linux, you can redirect the contents of a file into your program using the < operator. The command doCommand < infile will send the contents of infile to your program as if it were coming from the keyboard.

Input/Output Redirection Similarly, you can use the > operator to send the console output from your program into a file. doCommand > outfile You can do both operations at the same time with doCommand outfile