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
Unary operation
(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!
====Unix shell (Bash)==== In the [[Unix shell]] ([[Bash (Unix shell)|Bash]]/[[Bourne shell|Bourne Shell]]), e.g., the following operators are unary:<ref name="unixbash">{{cite web |title=Shell Arithmetic (Bash Reference Manual) |url=https://www.gnu.org/software/bash/manual/html_node/Shell-Arithmetic.html |website=www.gnu.org |publisher=GNU Operating System |access-date=24 April 2024}}</ref><ref name="unarybash">{{cite web |last1=Miran |first1=Mohammad Shah |title=Unary Operators in Bash |url=https://linuxsimply.com/bash-scripting-tutorial/operator/unary-operators/ |website=LinuxSimply |access-date=24 April 2024 |date=26 October 2023}}</ref> *Pre and Post-Increment: <code>++<span style="color:gray;">$x</span></code>, <code><span style="color:gray;">$x</span>++</code> *Pre and Post-Decrement: <code>--<span style="color:gray;">$x</span></code>, <code><span style="color:gray;">$x</span>--</code> *Positive: <code>+<span style="color:gray;">$x</span></code> *Negative: <code>-<span style="color:gray;">$x</span></code> *Logical negation: <code>!<span style="color:gray;">$x</span></code> * Simple expansion: <code>$<span style="color:gray;">x</span></code> * Complex expansion: <code>${#<span style="color:gray;">x</span>}</code>
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)