Right now I'm forced to resort to using uname to get the operating system name and it works. But in bash there is the OSTYPE environment variable that is automatically set and I was wondering if there is something similar.
Is there a way to detect OS in fish shell akin to the OSTYPE variable in bash?
3.1k Views Asked by RubenLaguna At
1
There are 1 best solutions below
Related Questions in FISH
- Error: fish: ${ is not a valid variable in fish
- Fish Abbreviation to Run Heredocs in Bash
- conda activate failed in fish
- Fish Shell Default PATH
- Get previous command in Fish shell
- Add `where:` field to fish_history?
- How to load a .env file's environment variables into both Bash and Fish shells on startup?
- fish shell + WebStorm terminal: how to use Alt + backspace to delete entire word
- How do I reliably check if I am inside systemd shell invoked by "systemd-run --shell"?
- Opening terminal in vscode
- Bash, Fish: prevent variable expansion
- How to partially select text of input in visual mode?
- How to make a fork bomb with fishshell?
- fish shell: filter $argv (lightweight / dynamic argparse)
- How to add Brew to path, Fish on Ventura
Related Questions in OS-DETECTION
- Is there methods to detect Windows-11 vs Windows-10 in Firefox browser?
- how to detect MacOS Sierra version in plain javascript
- How to detect Android OS from a Python script?
- How can I detect IOS version with server code at cshtml?
- Where does the OS take the value for $OSTYPE
- snort rules for OS detection
- How to detect Mac OS X version using C preprocessor?
- OS detection to display different links on WordPress page
- Determining the visitor's OS in PHP
- How to detect Windows 10 Anniversary Update on website?
- Is there a way to distinguish Android Arm os from the Android x86 os in JavaScript?
- Deprecated Javascript OS detection techniques
- Is OS detection possible with GLib?
- remote OS detection in python
- Is there a way to detect OS in fish shell akin to the OSTYPE variable in bash?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
From the fish user documentation it seems that the canonical way to execute code conditionally depending on the operating system type is using a
switchstatement with theunameresults. See example: