Sed Programming Language Directory @ eIT.in

 

eIT.ineverything IT is in Here   eIT Directory

 

 

 

Hot & Cool

 

SerkaiThe Web Cooperative

 

AntiSEThe Anti Search Engine

 

GeoDigBusinesses by Geography

 

Quali5Own a Keyword Forever

 

FollarsMaking Money from Open  Source

 

Billion Dollar Questions – and answers @ Billdoll.com

 

The Anti Bush Register – sign the register now!

 Advt 

 

eIT.in100’s of categories, 1000’s of IT resources

 

Software

 

Operating Systems, Programming & Development, Databases, Legacy & Mainframe, Internet

Hardware

 

Computer hardware and accessories, performance & maintenance, storage…

Networking & Communications

 

Networking architecture, infrastructure, administration, standards & protocols…

 

IT Infrastructure

 

ITIL, IT infrastructure management…

 

 

IT Support

 

Information technology & software support, administration, software testing, data centers…

 

IT in Industries

 

Information technology & software across industries

 

IT in Functions

 

Information technology & software across functional domains

 

IT Organizations & Industry Network

 

IT associations & organizations, IT related directories and trade networks…(Software Links Exchange)

 

IT Strategy & Design

 

Information technology & software architecture and design, IT strategy

 

IT News & Updates

 

IT news, updates, events & trade shows

IT Outsourcing Assistance


Use our services to locate the right vendor for a wide range of IT & software outsourcing domains

Related Links

 

Mainframes (Mainframe), AML, Analytics, Databases, EAI, BPO, CRM, Legacy, Legacy 2 Web, Middleware, IT Software Outsourcing & Offshoring Directory, Follars

 

 

Sed Programming Directory @ eIT.in

 

This section of eIT.in provides web resources for Sed programming language. 

 

Add Links: If you have a web site that you wish to include in this database, do let us know the details by sending a note about your URL to narsi@esource.in. We’ll quickly review the web site, and if found relevant, add it to the database. We look forward to web site owners and link exchange partners to submit URL. Thanks!  

 

 

Looking for an outsourcing partner for software programming & development? Have you talked to us?

 

 

   

 

..

 

..

 

 

Other IT Web Sites from eIT.in

 

 

Content derived from Wikipedia article on sed Programming Language

 

Sed

From Wikipedia, the free encyclopedia

 

 

 

sed (which stands for Stream EDitor) is a simple and powerful computer program used to apply various pre-specified textual transformations to a sequential stream of text data. It reads input files line by line, edits each line according to rules specified in its simple language (the sed script), and then outputs the line. While originally created as a Unix utility by Lee E. McMahon of Bell Labs from 1973 to 1974, sed is now available for virtually every operating system that supports a command line.

 

Contents

 

1 Functions

2 Usage

3 History

4 Samples

4.1 The Address Command (submatches)

5 Further reading

6 See also

7 External links

 

 

 

Functions

sed is often thought of as a non-interactive text editor. It differs from conventional text editors in that the processing of the two inputs is inverted. Instead of iterating once through a list of edit commands applying each one to the whole text file in memory, sed iterates once through the text file applying the whole list of edit commands to each line. Because only one line at a time is in memory, sed can process text files with an arbitrarily-large number of lines. Some implementations of sed can only process lines of limited lengths.

 

sed's command set is modeled after the ed editor, and most commands work similarly in this inverted paradigm. For example, the command 25d means if this is line 25, then delete (don't output) it, rather than go to line 25 and delete it as it does in ed. The notable exceptions are the copy and move commands, which span a range of lines and thus don't have straightforward equivalents in sed. Instead, sed introduces an extra buffer called the hold space, and additional commands to manipulate it. The ed command to copy line 25 to line 76 (25t76) for example would be coded as two separate commands in sed (25h; 76g), to store the line in the hold space until the point at which it should be retrieved.

 

 

Usage

The following example shows a typical usage of sed, where the -e option indicates that the sed expression follows:

 

sed -e 's/oldstuff/newstuff/g' inputFileName > outputFileName

The s stands for substitute; the g stands for global, which means that all matching occurrences in the line would be replaced. After the first slash is the regular expression to search for and after the second slash is the expression to replace it with. The substitute command (s///) is by far the most powerful and most commonly used sed command.

 

Under Unix, sed is often used as a filter in a pipeline:

 

generate_data | sed -e 's/x/y/g'

That is, generate the data, but make the small change of replacing x with y.

 

Several substitutions or other commands can be put together in a file called, for example, subst.sed and then be applied using the -f option to read the commands from the file:

 

sed -f subst.sed inputFileName > outputFileName

Besides substitution, other forms of simple processing are possible. For example, the following deletes empty lines or lines that only contain spaces:

 

sed -e '/^ *$/d' inputFileName

This example used some of the following regular expression metacharacters:

 

The caret (^) matches the beginning of the line.

The dollar sign ($) matches the end of the line.

A period (.) matches any single character.

The asterisk (*) matches zero or more occurrences of the previous character.

A bracketed expression delimited by [ and ] matches any of the characters inside the brackets.

Complex sed constructs are possible, to the extent that it can be conceived of as a highly specialised, albeit simple, programming language. Flow of control, for example, can be managed by use of a label (a colon followed by a string which is to be the label name) and the branch instruction b; an instruction b followed by a valid label name will move processing to the block following the label; if the label does not exist then the branch will end the script.

 

 

History

sed is one of the very early Unix commands that permitted command line processing of data files. It evolved as the natural successor to the popular grep command. Cousin to the later AWK, sed allowed powerful and interesting data processing to be done by shell scripts. sed was probably the earliest Unix tool that really encouraged regular expressions to be used ubiquitously. In terms of speed of operation, sed is generally faster than Perl in execution and markedly faster than AWK.

 

sed and AWK are often cited as the progenitors and inspiration for Perl; in particular the s/// syntax from the example above is part of Perl's syntax.

 

sed's language does not have variables and has only primitive GOTO and branching functionality; nevertheless, the language is Turing-complete. [1]

 

GNU sed includes several new features such as in-place editing of files (i.e., replace the original file with the result of applying the sed program). In-place editing is often used instead of ed scripts: for example,

 

sed -i 's/abc/def/' file

can be used instead of

 

ed file

1,$ s/abc/def/

w

q

There is an extended version of sed called Super-sed (ssed) that includes regular expressions compatible with Perl.

 

Another version of sed is minised, originally reverse-engineered from the 4.1BSD sed by Eric S. Raymond and currently maintained by René Rebe. minised was used by the GNU project until the GNU project wrote a new version of sed based on the new GNU regular expression library. The current minised contains some extensions to BSD sed but is not as feature-rich as GNU sed. Its advantage is that it is very fast and uses little memory. It is used on embedded systems and is the version of sed provided with Minix.

 

 

Samples

This example will enable sed, which usually only works on one line, to remove newlines from sentences where the second sentence starts with one space.

 

Consider the following text:

 

This is my cat

 my cat's name is betty

This is my dog

 my dog's name is frank

The sed script below will turn it into:

 

This is my cat my cat's name is betty

This is my dog my dog's name is frank

Here's the script:

 

sed 'N;s/\n / /;P;D;'

(N) add the next line to the work buffer

(s) substitute

(/\n /) match: \n and one space

(/ /) replace with: one space

(P) print the top line of the work buffer

(D) delete the top line from the work buffer and run the script again

 

The Address Command (submatches)

More complex substitutions are possible using the "Address" command:

 

/pattern1/s/pattern2/replacement/flags  

will replace pattern2 with replacement where pattern1 is matched.

Likewise:

 

/pattern1/!s/pattern2/replacement/flags 

will replace pattern2 where pattern1 is *not* matched.

For example, if you have a file (text.txt) containing the following lines:

 

Hello world.

Hello world. I love sed.

And you want to replace "world" with "mom", but only on those lines that contain the word "sed", you can use:

 

sed -e '/sed/s/world/mom/g' text.txt

will result in:

 

Hello world.

Hello mom.  I love sed.

You can negate this behavior with:

 

sed -e '/sed/!s/world/mom/g' text.txt

which will result in the opposite:

 

Hello mom.

Hello world.  I love sed.

 

Further reading

Arnold Robbins (June, 2002). sed and awk Pocket Reference, 2nd Edition. O'Reilly and Associates. ISBN 0-596-00352-8.

Peter Patsis (1998-12-30). UNIX AWK and SED Programmer's Interactive Workbook (UNIX Interactive Workbook). Prentice Hall. ISBN 0-13-082675-8.

The sed FAQ

GNU sed manual

Manual page for sed version 4.1.2, the program's manpage

 

See also

List of Unix programs

 

External links

Wikibooks How to has more about this subject:

sedMajor sources for sed scripts, files, usage

Handy one-line sed scripts

A home page for sed, some focus on Windows/DOS

Paper describing Turing machine in sed, and its universality

Turing machine in sed, the actual script

A calculator written in sed

Super-sed

sed Sokoban

GNU utilities for Win32

More on the address command and sub-matched replacements

Minised homepage

 

Unix command line programs (more)

File and file system management: cat | cd | chmod | chown | chgrp | cp | du | df | file | fsck | ln | ls | lsof | mkdir | more | mount | mv | pwd | rm | rmdir | split | touch | tree

Process management: anacron | at | chroot | crontab | kill | killall | nice | pgrep | pidof | pkill | ps | sleep | screen | time | timex | top | wait

User Management/Environment: env | finger | id | locale | mesg | passwd | su | sudo | uname | uptime | w | wall | who | write

Text processing: awk | cut | diff | ex | head | iconv | join | less | more | nkf | paste | sed | sort | tail | tr | uniq | wc | xargs

Shell programming: echo | expr | printf | unset Printing: lp

Communications:

inetd | netstat | ping | rlogin | traceroute Searching:

find | grep | strings Miscellaneous:

banner | bc | cal | man | size | yes

 

End of Wikipedia content, http://en.wikipedia.org/wiki/Sed

 

 

Web Resources for Sed Programming Language

 

 

 

 

More eIT.in References

 

o        Programming Languages

§         The A-Z of Programming Languages

§         A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z

§         S

·         S

·         Sed

·         Sail

·         SAS

·         Sather

·         Scheme

·         Scripting Languages

·         SDL

·         Self

·         SETL

·         Sh

·         Simula

·         Sisal

·         Smalltalk Programming

·         Snobol

·         SQL Programming

·         SR

 

Main Sections @ eIT.in

 

·          Free & Open Source Software

·          Operating Systems

o        Mainframe & Legacy Operating Systems

·         Midrange

·         Mainframe Operating Systems

·          Databases

·          Programming & Development Directory

o        Programming Languages

§         The A-Z of Programming Languages

§         A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z

·          Internet & Web

§         Web Servers

§         Application Servers

§         Server Side Scripting

§         Web Services

 

 

 

 

About eIT.in

 

eIT.in is a comprehensive directory for everything IT & Software. It contains over 500 categories, and well over 10,000 web resources

 

eIT.in provides directory and web links resources for the IT, software, programming & software development domains. It is intended to be useful for application, applications programmers & developers, software technology programmer & developer, databases software development, administrators & DBAs, application developers, strategy architect, design specialists and architects, migration, integration, customization consultants and customisation analysts, administration, maintenance & support professionals, outsourcing consultant, bespoke solutions programming developers & coders, project management & functional analyst, and for system administrators, testing & quality control engineers. It will make an effort to provide resources on tutorial/tutorials, guide, guides, tips, faq, faqs on these topics.

 

eIT.in content is available under GPL: All directory content at mainframe.in is under the General Public License (GPL). Under this license, anyone is free to copy & use any amount of directory content @ eIT.in, make changes to it and use it in any way they wish, as long as they also allow the same rights to anyone else for this content. The concept of GPL has been adapted from the GNU GPL of the Free Software Movement. To those who wish to use content from eIT.in, our only request is that they acknowledge the source and provide a link back to eIT.in. This is only a request!

 

Countries & Cities Where eIT.in Provides Assistance

 

eIT Cities: Bangalore, Chennai, Mumbai, Bhubaneswar, Mysore, Kolkaka, Delhi, Pune, Trivandrum, Hyderabad

 

You are the $$$ Section of eIT.in

 

Reference

 

GeoDig – Get Local!

 

Have you checked out the GeoDig directories for over 30 countries? GeoDig provides useful local and regional web resources for over 200 cities around the world. See the list of cities and countries for which GeoDig provides locality-specific web resources.

 

North America

USA - Alabama (AL) > Birmingham; Alaska; Arkansas (AR) > Little Rock; Arizona (AZ) > Phoenix, Las Vegas, Tucson; California (CA) > Los Angeles, San Francisco, Sacramento, Fresno, Bakersfield; Colorado, CO > Denver; Connecticut, CT > Hartford; District of Columbia, DC > Washington DC; Delaware (DE) > Wilmington; Florida > Miami, Orlando, Tampa, Orlando, Sarasota, West Palm Beach, Jacksonville; Georgia > Atlanta; Hawaii > Honolulu; Idaho; Illinois > Chicago; Indiana > Indianapolis; Iowa; Kansas (KS); Kentucky (KY) > Louisville; Louisiana (LA) > New Orleans, Baton Rouge; Maine; Maryland (MD) > Baltimore; Massachusetts > Boston, Springfield; Michigan > Detroit, Grand Rapids; Minnesota > Minneapolis-St. Paul; Mississippi (MS); Missouri (MO) > Kansas City, St. Louis; Montana; Nebraska (NE) > Omaha; Nevada (NV) > Las Vegas; New Hampshire; New Jersey (NJ) > Jersey City, Newark; New Mexico (NM) > Albuquerque; New York > New York, Buffalo, Rochester, Albany, Syracuse; North Carolina (NC) > Raleigh-Durham, Charlotte, Greensboro; North Dakota; Ohio> Columbus, Cincinnati, Cleveland, Toledo, Youngstown, Dayton; Oklahoma (OK) > Oklahoma City, Tulsa; Oregon > Portland; Pennsylvania > Philadelphia, Allentown, Pittsburgh, Harrisburg, Scranton, ; Rhode Island (RI) > Providence; South Carolina (SC) > Greenville; South Dakota; Tennessee (TN) > Knoxville, Memphis, Nashville; Texas > Austin, Dallas, Houston, San Antonio, El Paso, Austin, McAllen; Utah (UT) > Salt Lake City; Vermont; Virginia (VA) > Norfolk, Richmond; Washington > Seattle; West Virginia; Wisconsin (WI) > Milwaukee; Wyoming

Canada - Vancouver, Montreal, Toronto, Calgary, Ottawa-Gatineau, Edmonton, Quebec City, Winnipeg, Hamilton, London

 

You are the $$$ Section of eIT.in

 

Europe - UK - London, Glasgow, Manchester, Birmingham, Liverpool, Sheffield, Leeds, Bristol, Edinburgh, Leicester; France - Paris, Marseille, Lyon, Toulouse, Nice, Nantes, Strasbourg, Montpellier, Bordeaux; Germany - Frankfurt (Frankfurt am Main), Munich (München), Berlin, Düsseldorf, Hamburg, Cologne (Köln), Essen, Dortmund, Stuttgart, Bremen, Duisburg, Hannover, Nürnberg (Nuremberg), Dresden, Leipzig; Italy - Milan (Milano), Rome (Roma), Napoli (Naples), Torino (Turin), Palermo, Bologna, Firenze (Florence), Genova (Genoa); Spain - Madrid, Barcelona, Valencia, Sevilla, Zaragoza, Malaga, Murcia, Las Palmas, Bilbao; Scandinavia - Finland - Helsinki (Helsingin), Espoo, Tampere (Tampereen), Vantaa, Turku, Oulu, Sweden - Stockholm, Goteborg (Göteborg), Malmo (Malmö), Uppsala, Vasteras (Västerås), Denmark - Copenhagen (Københavns), Aarhus (Århus), Odense, Aalborg (Ålborg), Norway - Oslo, Bergen, Stavanger, Trondheim; Benelux - Belgium - Brussels (Brussel), Antwerp (Antwerpen), Ghent (Gent, Gand), Charleroi, Liège (Liege), Netherlands - Amsterdam, Rotterdam, Utrecht, Eindhoven, Tilburg, ‘s-Gravenhage (sGravenhage), Groningen, Luxembourg - Luxembourg City; PortugalLisbon; GreeceAthens; HungaryBudapest; PolandWarsaw; Switzerland - Zürich (Zurich), Geneva (Geneve, Genève), Basel, Bern (Berne), Lausanne; Austria - Linz, Vienna (Wien), Graz, Linz, Salzburg, Innsbruck; IrelandDublin

 

Asia - India - Mumbai, New Delhi, Bangalore; China & Hong Kong - Hong Kong, Beijing, Shanghai, Tianjin, Wuhan, Shenyang, Guangzhou, Harbin, Xian; Japan - Tokyo, Osaka, Yokohama, Nagoya, Sapporo, Kyoto, Kobe, Fukuoka, Kawasaki, Hiroshima; South Korea - Seoul, Pusa, Taegu, Incheon, Taejeon, Taiwan - Taipei; Malaysia - Kuala Lumpur; Singapore; Russia - Moscow, St Petersburg

 

You are the $$$ Section of eIT.in

 

Middle East - Turkey - Istanbul, Israel - Tel Aviv

 

Oceania - Australia - Sydney, Melbourne, Brisbane, Perth, Adelaide

 

Africa - South Africa - Johannesburg, Cape Town, Durban

 

 

 

 

© 2006, From eIT.ineverything IT is in Here

 

eIT.in is a product of eSource India & Sourcing India

 

Other eSource & Sourcing sites: IT & Software (Dir, SAP), BPO, Chemicals, Textiles, Plant Oils, dotMobi, Billion Dollar Questions,

Biodiesel Encyclopedia, Linens, ideOS, Follars – Free, Open-source Dollars, Quali5.com – Own A Keyword Forever, AntiSE, Serkai, Leather & Hide, GeoDig