Difference between revisions of "Rc"
(→Introduction) |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
==Introduction== | ==Introduction== | ||
− | [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html '''rc'''] is a command interpreter and programming language similar to [https://www.freebsd.org/cgi/man.cgi?query=sh&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports '''sh(1)''']. It is based on the AT&T Plan 9 shell of the same name. The shell offers a C-like syntax (much more so than the Cshell) and a powerful mechanism for manipulating variables. It is reasonably small and reasonably fast, especially when compared to contemporary shells. Its use is intended to be interactive, but the language lends itself well to scripts. | + | |
+ | [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html '''rc'''] is a command interpreter and programming language similar to [https://www.freebsd.org/cgi/man.cgi?query=sh&sektion=1&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports '''sh(1)''']. It is based on the AT&T Plan 9 shell of the same name. The shell offers a C-like syntax (much more so than the Cshell) and a powerful mechanism for manipulating variables. It is reasonably small and reasonably fast, especially when compared to contemporary shells. Its use is intended to be interactive, but the language lends itself well to scripts.<br/> | ||
+ | [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html '''rc'''] is the base of all scripts and files related to '''[[OpenRC]]'''. | ||
==SYNOPSIS== | ==SYNOPSIS== | ||
Line 23: | Line 25: | ||
There are Task like:<br/> | There are Task like:<br/> | ||
− | * [https://www.freebsd.org/cgi/man.cgi?query= | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#COMMANDS COMMANDS] |
− | ** Background Tasks | + | ** Background Tasks |
− | ** Subshells | + | ** Subshells |
− | ** Line continuation | + | ** Line continuation |
− | ** Quoting | + | ** Quoting Quoting |
** Grouping | ** Grouping | ||
** Input and output | ** Input and output | ||
** Pipes | ** Pipes | ||
** Commands as Arguments | ** Commands as Arguments | ||
− | * CONTROL STRUCTURES | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#CONTROL CONTROL STRUCTURES] |
** If-Else Statements | ** If-Else Statements | ||
** While and For Loops | ** While and For Loops | ||
** Switch | ** Switch | ||
** Logical Operators | ** Logical Operators | ||
− | * PATTERN MATCHING | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#PATTERN PATTERN MATCHING] |
− | * | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#LISTS LISTS AND VARIABLES] |
** List Concatenation | ** List Concatenation | ||
** Free Carets | ** Free Carets | ||
Line 46: | Line 48: | ||
** Flat Lists | ** Flat Lists | ||
** Backquote Substitution | ** Backquote Substitution | ||
− | * SPECIAL VARIABLES | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#SPECIAL SPECIAL VARIABLES] |
− | * FUNCTIONS | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#FUNCTIONS FUNCTIONS] |
− | * INTERRUPTS AND SIGNALS | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#INTERRUPTS INTERRUPTS AND SIGNALS] |
− | * BUILTIN COMMANDS | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#BUILTIN BUILTIN COMMANDS] |
** . [-i] | ** . [-i] | ||
** break | ** break | ||
Line 65: | Line 67: | ||
** wait | ** wait | ||
** whatis | ** whatis | ||
− | * EXAMPLES | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#EXAMPLES EXAMPLES] |
− | * EXIT STATUS | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#EXIT EXIT STATUS] |
− | * GRAMMAR | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#GRAMMAR GRAMMAR] |
− | * FILES | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#FILES FILES] |
− | * CREDITS | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#CREDITS CREDITS] |
− | * BUGS | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#BUGS BUGS] |
− | * INCOMPATIBILITIES | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#INCOMPATIBILITIES INCOMPATIBILITIES] |
− | * SEE ALSO | + | * [https://www.freebsd.org/cgi/man.cgi?query=rc&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html#SEE SEE ALSO] |
[[Category:Sysutils]] | [[Category:Sysutils]] |
Latest revision as of 04:38, 13 April 2020
Welcome to Rc. |
OpenRC | ||
---|---|---|
Scripts | ||
/etc/rc rc - shell |
/etc/rc.devd The generic hook into OpenRC. |
/sbin/rcorder Ordering rc-scripts |
/etc/init.d Scripts to run OpenRC |
/usr/local/etc/init.d Scripts to run OpenRC |
|
/etc/rc.d Scripts automatically executed at boot and shutdown |
/usr/local/etc/rc.d Special scripts |
|
Configuration | ||
/etc/devd.conf Configuration file for devd(8) |
/etc/conf.d Initscript Configuration Files |
/etc/rc.conf.d Smaller configuration files |
/etc/defaults/rc.conf Specifies the default settings for all the available options. |
/etc/rc.conf The global OpenRC configuration file |
/etc/rc.conf.ghostbsd GhostBSD specific configurations |
Tools/Helper | ||
/usr/sbin/sysrc Safely edit system rc files |
/bin/rc-status Shows which services are running |
/sbin/rc-update Add or delete services |
/sbin/rc-service Locate and run an OpenRC service |
||
Back to the System |
Contents
Introduction[edit]
rc is a command interpreter and programming language similar to sh(1). It is based on the AT&T Plan 9 shell of the same name. The shell offers a C-like syntax (much more so than the Cshell) and a powerful mechanism for manipulating variables. It is reasonably small and reasonably fast, especially when compared to contemporary shells. Its use is intended to be interactive, but the language lends itself well to scripts.
rc is the base of all scripts and files related to OpenRC.
SYNOPSIS[edit]
Syntax: rc [Option] [-c command] [arguments]
There are options with this letters: [-deiIlnopsvx]
If -c is present, commands are executed from the immediately following argument. Any further arguments to rc are placed in $*. Thus:
rc -c 'echo $*' 1 2 3
prints out: 1 2 3
COMMANDS[edit]
A simple command is a sequence of words, separated by white space (space and tab) characters that ends with a newline, semicolon (;), or ampersand (&). The first word of a command is the name of that command. If the name begins with /, ./, or ../, then the name is used as an absolute path name referring to an executable file. Otherwise, the name of the command is looked up in a table of shell functions, builtin commands, or as a file in the directories named by $path.
More Tasks[edit]
There are Task like:
- COMMANDS
- Background Tasks
- Subshells
- Line continuation
- Quoting Quoting
- Grouping
- Input and output
- Pipes
- Commands as Arguments
- CONTROL STRUCTURES
- If-Else Statements
- While and For Loops
- Switch
- Logical Operators
- PATTERN MATCHING
- LISTS AND VARIABLES
- List Concatenation
- Free Carets
- Variables
- Local Variables
- Variable Subscripts
- Flat Lists
- Backquote Substitution
- SPECIAL VARIABLES
- FUNCTIONS
- INTERRUPTS AND SIGNALS
- BUILTIN COMMANDS
- . [-i]
- break
- builtin
- cd
- echo
- eval
- exec
- exit
- limit
- newpgrp
- return
- shift
- umask
- wait
- whatis
- EXAMPLES
- EXIT STATUS
- GRAMMAR
- FILES
- CREDITS
- BUGS
- INCOMPATIBILITIES
- SEE ALSO