Docsity

Scripting Languages: An Overview of Various Types and Their Uses, Study notes of Object Oriented Programming

Toggle sidebar
bg1
Scripting Languages
• A scripting language is used by putting a list of commands called a script, in a file
to be executed.
• A scripting language is also like programming language using set of commands to
control one or more software applications.
Ex. Writing the Macro using VB Script in MS Word, Excel
1st Bash/Korn Shell – Shell Programming (Operating System - shell
programming using Linux)
The first of these languages, named sh (for shell) began as a small collection of
commands that were interpreted as calls to system subprograms that performed utility
functions such as file management and simple file filtering.
AWK
Awk is a full-featured text processing language.
Awk breaks each line of input passed to it into fields. By default, a field is a string of
consecutive characters delimited by white space, though there are options for changing
this. Awk parses and operates on each separate field.
2nd World Wide Web
Client Side Scripting done by VB Script or Java Script.
Server Side Scripting PERL, PHP, ASP, JSP
PERL
Perl is a general-purpose programming language originally developed for text
manipulation and now used for a wide range of tasks including system administration,
web development, network programming, GUI development, and more.
The language is intended to be practical (easy to use, efficient, complete) rather
than beautiful (tiny, elegant, minimal). Its major features are that it's easy to use, supports
both procedural and object-oriented (OO) programming, has powerful built-in support for
text processing.
pf3

Partial preview of the text

Download Scripting Languages: An Overview of Various Types and Their Uses and more Study notes Object Oriented Programming in PDF only on Docsity!

Scripting Languages

  • A scripting language is used by putting a list of commands called a script, in a file to be executed.
  • A scripting language is also like programming language using set of commands to control one or more software applications. Ex. Writing the Macro using VB Script in MS Word, Excel

1 st^ Bash/Korn Shell – Shell Programming (Operating System - shell

programming using Linux)

The first of these languages, named sh (for shell) began as a small collection of commands that were interpreted as calls to system subprograms that performed utility functions such as file management and simple file filtering.

AWK

Awk is a full-featured text processing language.

Awk breaks each line of input passed to it into fields. By default, a field is a string of consecutive characters delimited by white space, though there are options for changing this. Awk parses and operates on each separate field.

2 nd^ World Wide Web

Client Side Scripting done by VB Script or Java Script.

Server Side Scripting PERL, PHP, ASP, JSP PERL

Perl is a general-purpose programming language originally developed for text manipulation and now used for a wide range of tasks including system administration, web development, network programming, GUI development, and more.

The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal). Its major features are that it's easy to use, supports both procedural and object-oriented (OO) programming, has powerful built-in support for text processing.

Example program

Renaming Files #!/usr/local/bin/perl

rename series of frames

if ($#ARGV != 3) { print "usage: rename old new start stop\n"; exit; }

$old = $ARGV[0]; $new = $ARGV[1]; $start = $ARGV[2]; $stop = $ARGV[3];

for ($i=$start; $i <= $stop; $i++) {

$num = $i; if($i<10) {$num = "00$i"; } elsif($i<100) { $num = "0$i"; } $cmd = "mv $old.$num $new.$num"; print $cmd."\n"; if(system($cmd)) { print "rename failed\n"; } }

PHP

  • PHP stands for P HP: H ypertext P reprocessor
  • (^) PHP is a server-side scripting language, like ASP
  • PHP scripts are executed on the server
  • PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
  • PHP files can contain text, HTML tags and scripts
  • PHP files are returned to the browser as plain HTML

PHP scripts are always enclosed in between two PHP tags. This tells your server to parse the information between them as PHP. The three different forms are as follows: