Category:UNIX Shell
This programming language may be used to instruct a computer to perform a task.
Execution method: | Interpreted |
---|---|
Lang tag(s): | bash |
See Also: |
|
The UNIX Shell is a component of terminal-based UNIX-derived systems which offers both a command-line interface for running system commands, as well as programming interface for intelligently automating tasks which use system commands.
Implementation
There are many UNIX Shells and most of them can be categorized into two families. For purposes of the Rosetta Code, all examples are in Bourne-compatible syntax. The other family of shells, with a markedly different syntax, are csh (C Shell) and its tcsh (Tenex C Shell) "clone." Common Bourne compatible shells include the original Bourne Shell (/bin/sh on most versions of UNIX), the GNU Bourne Again SHell (bash --- which is linked to /bin/sh on many distributions of Linux, making it their default shell), the Korn Shell (ksh), the Public Domain Korn SHell (pdksh), the Almquist SHell (ash) and the Debian Almquist SHell (dash) and the Z SHell (zsh).
Main article: UNIX Shell Implementations
Language
While UNIX Shells vary in the programming languages they support, such languages carry a minimum set of features. Each language allows the programmer to execute system commands as though he were typing the commands himself, and each language allows for a header line which specifies which shell implementation is used to interpret the script.
This one tells the operating system to use the Bourne Shell:
#!/bin/sh
This line tells the operating system to use the Bourne Again SHell:
#!/bin/bash
And this one tells the operating system to use the Korn Shell:
#!/bin/ksh
Each header line consists of a hash, a bang, and the path to the interpreter binary.
Subcategories
This category has the following 5 subcategories, out of 5 total.
@
- UNIX Shell User (161 P)
- Bash User (49 P)
- Korn Shell User (11 P)
Pages in category "UNIX Shell"
The following 200 pages are in this category, out of 355 total.
(previous page) (next page)2
A
- A* search algorithm
- A+B
- ABC problem
- Accumulator factory
- Ackermann function
- Active Directory/Search for a user
- Align columns
- Anagrams
- Anagrams/Deranged anagrams
- Anonymous recursion
- Append a record to the end of a text file
- Apply a callback to an array
- Arithmetic-geometric mean
- Arithmetic/Complex
- Arithmetic/Integer
- Array concatenation
- Array length
- Arrays
- Assertions
- Associative array/Creation
- Associative array/Iteration
- Averages/Arithmetic mean
- Averages/Mode
B
C
- Caesar cipher
- Calculating the value of e
- Calendar
- Calendar - for "REAL" programmers
- Call a function
- Canonicalize CIDR
- Cartesian product of two or more lists
- Case-sensitivity of identifiers
- Character codes
- Check input device is a terminal
- Check output device is a terminal
- Check that file exists
- Chinese zodiac
- Classes
- Code Golf: Code Golf
- Collections
- Colour bars/Display
- Comma quibbling
- Command-line arguments
- Comments
- Compound data type
- Conditional structures
- Conway's Game of Life
- Copy a string
- Count in octal
- Count occurrences of a substring
- Count the coins
- Create a file
- Create a file on magnetic tape
- Create an HTML table
- CSV data manipulation
- CSV to HTML translation
D
- Date format
- Date manipulation
- Day of the week
- Days between dates
- Deal cards for FreeCell
- Deceptive numbers
- Define a primitive data type
- Delete a file
- Department numbers
- Determine if a string is numeric
- Determine if only one instance is running
- Digital root
- Dinesman's multiple-dwelling problem
- DNS query
- Doomsday rule
- Dutch national flag problem
- Dynamic variable names
E
F
- Factorial
- Factors of an integer
- Fibonacci sequence
- File input/output
- File modification time
- File size
- File size distribution
- Filter
- Find common directory path
- Find limit of recursion
- Find the last Sunday of each month
- Find words which contains all the vowels
- Five weekends
- FizzBuzz
- Fork
- Four bit adder
- Four is magic
- FTP
- Function composition
- Function definition
G
H
- Hailstone sequence
- Hamming numbers
- Handle a signal
- Happy numbers
- Harshad or Niven series
- Hash from two arrays
- Hello world/Graphical
- Hello world/Line printer
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Text
- Hello world/Web server
- Here document
- Host introspection
- Hostname
- HTTP
- HTTPS
- Huffman coding
I
J
L
- Langton's ant
- Last Friday of each month
- Leap year
- Least common multiple
- Linear congruential generator
- Linux CPU utilization
- Literals/Integer
- Literals/String
- Logical operations
- Long literals, with continuations
- Long multiplication
- Long year
- Longest common prefix
- Look-and-say sequence
- Loop over multiple arrays simultaneously
- Loops/Break
- Loops/Continue
- Loops/Do-while
- Loops/Downward for
- Loops/For
- Loops/For with a specified step
- Loops/Foreach
- Loops/Infinite
- Loops/N plus one half
- Loops/Nested
- Loops/While
- Luhn test of credit card numbers