All Questions
12
questions
1
vote
3
answers
602
views
SSH with Command Doesn't Run as an Alias
I have the following command to remote into a local server and tail -f the latest log file for an application that I have.
The command works perfectly fine from the command line -
ssh user@hostname ...
1
vote
1
answer
2k
views
Do shell functions and aliases fork child processes?
Do shell functions and aliases fork child processes? Or are they both executed within the shell process?
2
votes
3
answers
3k
views
Bash (Git) - Functions, Alias, and SH script files
I have gotten quite prolific with the use of the aliases, especially with all the different git commands and their order and interdependencies etc. So, I've created a few alias that run more complex ...
14
votes
1
answer
21k
views
Bash alias with a space as a part of the command
I'm trying to create a bash alias, where the alias itself has a space in it.
The idea is that the alias (i.e. con) stands for sudo openvpn --config /path/to/my/openvpn/configs/. Which results in a ...
1
vote
1
answer
102
views
Aliasing a command with special parameters [duplicate]
I would like to have an alias for the following code:-
g++ *.cc -o * `pkg-config gtkmm-3.0 --cflags --libs`;
but I want that when I enter the alias it should be followed by the file name *.cc and ...
1
vote
1
answer
58
views
Aliasing a command with parameter supplied to another command
Namely: I want to alias tail -f to less +F but let tail with any other parameter supplied work the same way as before.
5
votes
2
answers
3k
views
Why alias inside function does not work? [duplicate]
See the code below:
a()(alias x=echo\ hi;type x;alias;x);a
I have an alias inside a function, I do not want to change the external environment (that is why I am using () instead of {}), even the ...
39
votes
3
answers
15k
views
How to test if command is alias, function or binary?
I have command foo, how can I know if it's binary, a function or alias?
11
votes
5
answers
4k
views
What are commands to find shell keywords, built in functions and user defined functions?
I was discussing with my friend on how the commands are parsed in the shell, and he told me that bash searches the command in following order
List of aliases
List of shell keywords
List of ...
2
votes
2
answers
2k
views
awk function with a number parameter for the column you want to print
I want to use my awk shortcut as a function, so that I can pass the column number which then prints me the output. My aliases are:
alias A="| awk '{print \$1}'
alias G="| grep -i'
Instad of typing:
...
4
votes
2
answers
1k
views
Combine two commands in .bash_profile
In my .bash_profile file, I'd like to setup a single command alias that is two commands that execute one after another. The first command takes an argument from the command line and the second is ...
44
votes
1
answer
12k
views
Aliases vs functions vs scripts [duplicate]
This site says, "Shell functions are faster [than aliases]. Aliases are looked up after functions and thus resolving is slower. While aliases are easier to understand, shell functions are preferred ...