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
- How to add entry to fish shell history?
- How to edit fishshell startup script
- pip with virtualenv requires sudo
- Use Function From Earlier in Function Path
- Suppress filename/directory completion in fish shell
- fish shell and global npm modules
- Ctrl+S in fish shell does not work as in bash
- Create Custom Fish Switches
- How to create a alias in fish shell
- check if argv is a directory
- AWS CLI command completion with fish shell
- Compiling fish shell under MSYS?
- Bash (or other shell): wrap all commands with function/script
- Assign a fish function to another name
- How to find the file defining a fish function?
Related Questions in OS-DETECTION
- remote OS detection in python
- Show or Hide Div based on OS
- tell if make is running on windows or linux
- How to detect Mac OS X version using C preprocessor?
- Get users OS and version number
- Where does the OS take the value for $OSTYPE
- How can I detect IOS version with server code at cshtml?
- How to guess the most likely OS and interpret it when using nmap
- JavaScript to detect OS in Chrome Version 37.0.2062.94
- OS detecting makefile
- Is there a way to distinguish Android Arm os from the Android x86 os in JavaScript?
- How to detect Android OS from a Python script?
- how to detect MacOS Sierra version in plain javascript
- OS detection to display different links on WordPress page
- Is there methods to detect Windows-11 vs Windows-10 in Firefox browser?
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 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: