LinuxCommandLibrary

sam

Filter, manipulate, and analyze sequence alignments

TLDR

Initialize a serverless application

$ sam init
copy

Initialize a serverless application with a specific runtime
$ sam init [[-r|--runtime]] [python3.7]
copy

Package a SAM application
$ sam package
copy

Build your Lambda function code
$ sam build
copy

Run your serverless application locally
$ sam local start-api
copy

Deploy an AWS SAM application
$ sam deploy
copy

SYNOPSIS

sam [ -d debug_level ] [ -i initial_command ] [ -k key_sequence ] [ -t terminal_type ] [ filename ... ]

PARAMETERS

-d debug_level
    Enables debugging output at the specified level. Higher values provide more detailed information. Common debug levels are 1-5.

-i initial_command
    Specifies an initial command to be executed upon startup. Useful for automating tasks or initializing the editor's state.

-k key_sequence
    Defines a key sequence to be used for invoking commands. Allows for customization of the editor's key bindings.

-t terminal_type
    Specifies the terminal type. Necessary for correct display and input handling, particularly in older terminal environments.

filename ...
    Specifies one or more files to be opened for editing. If no filename is provided, Sam starts with an empty buffer.

DESCRIPTION

Sam is a powerful, screen-oriented text editor initially developed at Bell Labs. Unlike many other text editors, Sam is command-driven and emphasizes regular expressions and scripting. It is particularly useful for large files and complex text manipulations.

Sam operates on a buffer representing the file being edited. Commands are entered in a command language which allows for selecting regions of text, applying regular expressions, and executing scripts. The editor provides features such as multiple windows, undo/redo functionality, and the ability to execute external programs. It's especially favored by programmers and advanced users who require precise control over their text editing workflows.

CAVEATS

Sam can be daunting for users accustomed to graphical text editors. Its command-driven interface requires learning a specialized syntax. The editor's performance on very large files depends on the underlying hardware and operating system.

COMMAND LANGUAGE

Sam's strength lies in its command language. This language allows users to select text based on regular expressions, apply transformations, and execute scripts. Users can define macros and functions to automate common tasks, making Sam highly customizable.

REGULAR EXPRESSIONS

Sam provides powerful regular expression support for searching and manipulating text. Regular expressions can be used to select specific lines, words, or patterns within the file. This makes Sam well-suited for tasks such as code refactoring, data extraction, and text processing.

WINDOWING

Sam supports multiple windows, allowing users to view and edit different parts of the same file or multiple files simultaneously. This can be helpful for comparing code, navigating large documents, or working on multiple tasks at once.

HISTORY

Sam was originally developed by Rob Pike at Bell Labs, a research lab known for its contributions to Unix and other fundamental technologies. It was designed to be a more powerful and flexible alternative to existing text editors like ed and vi. Sam's influence can be seen in later text editors and integrated development environments. It remains a powerful tool for users who value its command-line nature and regular expression capabilities.

SEE ALSO

ed(1), sed(1), vi(1)

Copied to clipboard