sam
Filter, manipulate, and analyze sequence alignments
TLDR
Initialize a serverless application
Initialize a serverless application with a specific runtime
Package a SAM application
Build your Lambda function code
Run your serverless application locally
Deploy an AWS SAM application
SYNOPSIS
sam [options] [file ...]
PARAMETERS
file ...
One or more files to be opened for editing upon startup.
-r
Open files in read-only mode, preventing accidental writes.
-d
Detach sam from the controlling terminal, often used for server mode.
-s
Start sam as a server, allowing other clients to connect to it.
-i command
Execute the specified sam command string after startup.
DESCRIPTION
The Sam editor is a powerful and unique text editor originating from Bell Labs' Plan 9 operating system, designed by Rob Pike. Unlike typical line-oriented or screen-oriented editors, Sam emphasizes a structural approach to text manipulation through its integrated command language and powerful regular expressions, often referred to as 'structural regular expressions'. It excels at complex, programmatic text transformations across multiple files or large documents. While not a standard utility on most mainstream Linux distributions, Sam can be compiled and run on Linux systems, offering an alternative editing paradigm for those accustomed to its Plan 9 philosophy or seeking its distinct capabilities for scripting text edits.
CAVEATS
Sam is not a standard utility on most mainstream Linux distributions and typically needs to be compiled from source or installed from specialized repositories. Its unique command language and interaction model can have a steep learning curve for users accustomed to more conventional editors like Vim or Emacs. Its primary strength lies in programmatic text manipulation rather than simple interactive editing, which might not suit all users or workflows.
COMMAND LANGUAGE AND STRUCTURAL REGULAR EXPRESSIONS
Sam's power largely stems from its internal command language, which allows complex text manipulations using sequences of commands. A core concept is 'structural regular expressions', which extends traditional regular expressions to operate on arbitrarily large textual structures, enabling powerful and precise selection of text regions for editing. This feature makes Sam particularly effective for batch processing or scripting complex text transformations.
HISTORY
The Sam text editor was designed by Rob Pike at Bell Labs for the Plan 9 operating system, with its initial public release occurring around the late 1980s. It was conceived as an improvement over traditional line editors like ed, combining a powerful command language with structural regular expressions and a mouse-driven interface. Its development was deeply intertwined with the philosophy of Plan 9, emphasizing simplicity, clear interfaces, and composability. While primarily a Plan 9 tool, its unique design led to ports and implementations on other Unix-like systems, including Linux, preserving its distinct approach to text editing outside its native environment.