Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Multics
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Active functions === The Multics [[shell (computing)|shell]] language supports "active functions", which are similar to commands, but which return a string value. An active function is called by putting the active function name and the arguments to the active function in square brackets {{mono|[}} and {{mono|]}}. The string returned by the active function is substituted into the command in place of the call to the active function. For example, when the command {{mono|echo [working_dir]}} is processed, the active function {{mono|working_dir}} is run; it returns the full path of the [[working directory]], which is substituted into the command, so that the {{mono|echo}} command prints the working directory. Some programs can act either as commands or as active functions; when run as a command, its result is printed, and when run as an active function, its result is returned as a string.<ref name="multics-commands" /> Some common active functions are: * {{mono|[[Floor and ceiling functions|ceil]]}} - returns the smallest integer greater than or equal to the argument * {{mono|[[Floor and ceiling functions|floor]]}} - returns the largest integer less than or equal to the argument * {{mono|home_dir}} ({{mono|hd}}) - returns the [[home directory]] * {{mono|[[ltrim]]}} * {{mono|[[rtrim]]}} * {{mono|[[Truncation|trunc]]}} - returns the integer part of the argument * {{mono|working_dir}} ({{mono|wd}}) - returns the [[working directory]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)