I recently came across this # -*- sh -*- at the top of a file with aliases in them. It was part of someone's dotfiles inside their bash directory and, until now, I've never seen it before. So, what is this and how is it different than using a shebang? I tried googling alternatives to a shebang, but came up with nothing that gives me a hint as to what the above is. 
Bash Aliases and Dotfiles
574 Views Asked by kyle At
1
There are 1 best solutions below
Related Questions in BASH
- How do I recursively find and replace only in files named index.php on Linux webserver?
- Delete the extra space after special character in all the lines of text file
- Calling a python function with options from shell script
- bc: prevent "divide by zero" runtime error on multiple operations
- Multiple commands with find and xargs, also accounting for special characters
- How to split a directory into parts without compressing or archiving?
- concat a lot of files to stdout
- Honoring quotes while reading shell arguments from a file
- No laravel sync folders in homestead vagrant on windows
- Grouping commands in curly braces and piping does not preserve variable
- SWI Prolog pass a goal with non-zero arity through the command line arguments
- Evaluating condition of if statement in awk using a second file
- How to customise bash completion to pick only a custom set of commands?
- Bash regular expression execution hangs on long expressions
- Bitwise OR in bash arguments with square brackets
Related Questions in DOTFILES
- Bash Aliases and Dotfiles
- What common dotfiles are unsafe to share?
- Vim: Custom mapping for surround plugin to surround visual selection?
- Why do you need dotfiles_old when you are creating dotfiles
- Emacs/Spacemacs: additional packages installed do not load unless dotfile synced with M-m f e R
- Getting ack to search through .htaccess or other dotfiles
- How do I filter dotfiles out recursively using find in bash?
- Homesick with bash-it as submodule
- Why doesn't GNU Stow ignore single files in main directory?
- Syncing dot files with dropbox
- Loading of .bashrc fails when I open "first" terminal. But is loaded when I open tmux and/or I try to create new window with Ctrl+SHIFT+N
- How do I handle different configuration paths on *nix and Windows with chezmoi?
- Chezmoi: How to ignore a file if its content exists in a different file?
- c++ can't seem to filter out the dot files in my recursive directory listing program
- Stow and replace existing dotfiles
Related Questions in ALIASES
- Improve function that adds aliases to .bashrc from command line
- Use Function From Earlier in Function Path
- Bash Aliases and Dotfiles
- PHP MVC Namespacing and Aliasing
- google analytics multi domain aliases web
- How to make aliases automatically work at startup?
- how to create aliases of records in oracle sql
- Semantic meanings of std::auto_ptr and boost::shared_ptr
- Global type aliases in C#
- Prevent the user from changing their e-mail aliases
- git alias taking all given arguments
- How to alias a tag in Git?
- List of aliases of an user with gmail API in PHP
- vscode aliases "Go To definition" fail on huge project
- SQL multiple aliases alongside query
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?
Files with alias definitions do not need shebang lines, because executing them stand-alone would not add the definitions to the current shell, which is the point of alias definitions.
Instead, files with alias definitions must be sourced (run in the context of the current shell, with
sourceor.).Thus, what you're seeing is just an ordinary comment that indicates what specific shell (
sh) the file is designed to be sourced from.