Questions tagged [alias]

An alias is an alternative name. In computer science, the most common contexts are command aliases in shells, column aliases in databases, or variable references in languages like C++.

For bash aliases use the tag.

4406 questions
27
votes
2 answers

Is it possible to alias an enum-class enumerator?

Given a C++11 enum class, nested inside several long- and ugly-named namespaces: namespace long_and_ugly { enum class colour { red, green, blue }; } Can aliases be made of the enumeration values? With…
djsp
  • 2,174
  • 2
  • 19
  • 40
27
votes
6 answers

Using alias in query and using it

I have a doubt and question regarding alias in sql. If i want to use the alias in same query can i use it. For eg: Consider Table name xyz with column a and b select (a/b) as temp , temp/5 from xyz Is this possible in some way ?
asb
  • 910
  • 3
  • 10
  • 19
26
votes
7 answers

Using an alias in find -exec

I have a very long command in bash, which I do not want to type all the time, so I put an alias in my .profile alias foo='...' Now I want to execute this alias using find -exec find . -exec foo '{}' \; but find cannot find foo: find: foo: No such…
Jesse van Bekkum
  • 1,466
  • 3
  • 15
  • 24
26
votes
4 answers

Intercept the same API call multiple times in Cypress

Is it possible to use cy.intercept to intercept the same API call multiple times in the same test? I tried the following: cy.intercept({ pathname: "/url", method: "POST" }).as("call1") // ... some logic cy.wait("@call1") // ... some…
Bob van 't Padje
  • 685
  • 1
  • 6
  • 17
25
votes
5 answers

Why would I create an alias which creates a function?

I see this pattern every once in a while, especially in questions about Bash prompt customization. alias f='_ () { useful code; }; _' I can see no reason at all to create an alias here. The obvious refactoring f () { useful code; } which avoids…
tripleee
  • 175,061
  • 34
  • 275
  • 318
25
votes
5 answers

executing shell script without calling sh implicitly

I was wondering if it is possible to make a "link" in usr/bin (i.e.) that leads to a shell-script. But I want just to write % shellscript instead of % sh shellscript.sh kinda like an alias. Is this possible?
ShoX
  • 577
  • 2
  • 7
  • 14
25
votes
1 answer

git add and commit single tracked file in one command

I'm looking for the equivalent of git commit -am "blah blah" but for just a single file. If I try: git commit my.file -am "blah blah" I get: fatal: Paths with -a does not make sense. I looked around but I could only find solutions that suggest…
BrodieG
  • 51,669
  • 9
  • 93
  • 146
25
votes
1 answer

Create an Alias Directory inside a Virtual Host

I checked here, here, here, here, and here before asking this question. I guess my search skills are weak. I am using the WampServer version 2.2e. I have a need like, I need a virtual path inside a virtual host. Let me say the two hosts that I…
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
25
votes
2 answers

Where is my git alias stored?

I have an alias that I cannot find. Typing git help subaddvim gives me: `git subaddvim' is aliased to `log HEAD' I think I defined it like this: git config --local alias.subaddvim 'log HEAD' I looked in $repo_path/.gitconfig, ~/.gitconfig,…
idbrii
  • 10,975
  • 5
  • 66
  • 107
24
votes
3 answers

Extending Union Types Alias in TypeScript?

I'm trying to limit some string fields to be only of certain values at compile time. The problem is that those values should be extendable. Here's a simplified example: type Foobar = 'FOO' | 'BAR'; interface SomeInterface { …
durilka
  • 1,399
  • 1
  • 10
  • 22
24
votes
3 answers

How does `alias sudo="sudo "` work?

Looking at ways to pass current user's aliases to a sudo command, I found the following on ArchWiki: Passing aliases If you use a lot of aliases, you might have noticed that they do not carry over to the root account when using sudo. However,…
PLNech
  • 3,087
  • 1
  • 23
  • 52
24
votes
1 answer

How to create an alias with multiple commands that accepts parameters in Cmder?

I would like to know how to create one alias with multiple commands in Cmder, that accepts parameters and injects them into the commands.
Ramtin Soltani
  • 2,650
  • 3
  • 24
  • 45
24
votes
3 answers

Can you alias a scope in Rails?

Say I have this scope: scope :with_zipcode, lambda { |zip| where(zipcode: zip) } and I want an equivalent scope scope :has_zipcode, lambda { |zip| where(zipcode: zip) } is there a way to alias one scope to another? For instance something…
24
votes
3 answers

java generics covariance

I am having trouble understanding the following article: http://www.ibm.com/developerworks/java/library/j-jtp01255.html Under, Generics are not covariant the author states, Because ln is a List, adding a Float to it seems perfectly legal. But if…
soocracy42
  • 251
  • 1
  • 2
  • 4
24
votes
2 answers

difference between (defalias 'A (symbol-function 'B)) and (defalias 'A 'B)

I was reading subr.el and saw this code: (defalias 'backward-delete-char 'delete-backward-char) (defalias 'search-forward-regexp (symbol-function 're-search-forward)) Interestingly, the first line doesn't use symbol-function while the second line…
Yoo
  • 17,526
  • 6
  • 41
  • 47