recentpopularlog in


« earlier   
fc - "fix command"
In the KornShell, the alias r (``re-do") is preset to fc -e - (equivalent to the POSIX fc -s). This is probably an easier command name to remember than fc (``fix command"), but it does not meet the Utility Syntax Guidelines. Renaming fc to hist or redo was considered, but since this description closely matches historical KornShell practice already, such a renaming was seen as gratuitous. Users are free to create aliases whenever odd historical names such as fc, awk, cat, grep, or yacc are standardized by POSIX.
fc  history  unix  posix  butwhy  explained 
3 days ago by kme
unix - Bash script to receive and repass quoted parameters - Stack Overflow
Q: I'm trying to get quoted parameters of a bash script to safely be received by a nested script. Any ideas? [...]
2009  2015  shell  bash  posix  links  tips  example  forumthread  stackexchange  unix  scripting 
7 days ago by ezequiel
~sircmpwn/shit - sourcehut git
'This is an implementation of Git using (almost) entirely POSIX shell."
minimal  git  posix  sh 
12 days ago by jbkcc
domain - Create Unix Named Socket from the Command Line - Server Fault
A: Is there a command similar to mkfifo but for domain sockets?
Q: There is no exact equivalent of mkfifo for socket, i.e. there is no command that just creates a "hanging" socket. This is for historical reason: server's function bind(), the one that creates a socket name/inode in the filesystem, fails if the name is already used. In other words, server cannot operate on a pre-existing socket. [...]
2012  forumthread  stackexchange  sockets  cli  unix  linux  tips  example  posix 
5 weeks ago by ezequiel
linux - How do I detach a process from Terminal, entirely? - Super User
Q: [...] However, I'm struggling with how to completely detach a process (e.g. Firefox) from the terminal it's been launched from - i.e. prevent that such a (non-)child process

* is terminated when closing the originating terminal
* "pollutes" the originating terminal via STDOUT/STDERR
2009  2011  forumthread  stackexchange  unix  linux  posix  shell  tool  cli  example  tips 
5 weeks ago by ezequiel
Morbig: A Static Parser for POSIX Shell
Yann Régis-Gianas, Nicolas Jeannerod, Ralf Treinen

“The POSIX shell language defies conventional wisdom of compiler construction on several levels: The shell language was not designed for static parsing, but with an intertwining of syntactic analysis and execution by expansion in mind. Token recognition cannot be specified by regular expressions, lexical analysis depends on the parsing context and the evaluation context, and the shell grammar given in the specification is ambiguous. Besides, the unorthodox design choices of the shell language fit badly in the usual specification languages used to describe other programming languages. This makes the standard usage of Lex and Yacc as a pipeline inadequate for the implementation of a parser for POSIX shell. The existing implementations of shell parsers are complex and use low-level character-level parsing code which is difficult to relate to the POSIX specification. We find it hard to trust such parsers, especially when using them for writing automatic verification tools for shell scripts.

This paper offers an overview of the technical difficulties related to the syntactic analysis of the POSIX shell language. It also describes how we have resolved these difficulties using advanced parsing techniques (namely speculative parsing, parser state introspection, context-dependent lexical analysis and longest-prefix parsing) while keeping the implementation at a sufficiently high level of abstraction so that experts can check that the POSIX standard is respected. The resulting tool, called Morbig, is an open-source static parser for a well-defined and realistic subset of the POSIX shell language.”

paper  PLT  parsing  POSIX  sh  bash  formal-verification  functional-programming  ML  OCaml 
5 weeks ago by elliottcable
Create beautiful command-line interfaces with Python
> IEEE standard 1003.1, also known as *POSIX*
video  posix  unix 
6 weeks ago by FND
How to check if a shell is login/interactive/batch - Unix & Linux Stack Exchange
Q: I think I understand the differences between an interactive, a login and a batch shell. See the following links for more help:

* What is the difference between a 'Login' and an 'Interactive' bash shell (from the sister site:
* 2.1: Types of shell: interactive and login shells (from A User's Guide to the Z-Shell)

My question is, how can I test with a command/condition if I am on an interactive, a login or a batch shell? [...]

A: I'm assuming a bash shell, or similar, since there is no shell listed in the tags.

* To check if you are in an interactive shell:

[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'

* To check if you are in a login shell:

shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'

By "batch", I assume you mean "not interactive", so the check for an interactive shell should suffice.
2011  forumthread  links  scripting  shell  bash  posix  example  tips  cli  script  linux  unix 
7 weeks ago by ezequiel

Copy this bookmark:

to read