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
35
votes
3 answers

Alias target name in Makefile

The Problem: Is it possible to give a target a different name or alias, such that it can be invoked using either the original target name or the alias. For example something like /very/long/path/my_binary: dep_a dep_b dep_c # Compile # Desired…
WaelJ
  • 2,942
  • 4
  • 22
  • 28
35
votes
3 answers

Prevent bash alias from evaluating statement at shell start

Say I have the following alias. alias pwd_alias='echo `pwd`' This alias is not "dynamic". It evaluates pwd as soon as the shell starts. Is there anyway to delay the evaluation of the expression in the ticks until the alias's runtime?
Martin Konecny
  • 57,827
  • 19
  • 139
  • 159
34
votes
2 answers

How to alias a function name in Fortran

Not sure if the title is well put. Suggestions welcome. Here's what I want to do. Check a condition, and then decide which function to use in a loop. For example: if (a < 0) then loop_func = func1 else loop_func = func2 endif I can then use…
Samuel Tan
  • 1,700
  • 5
  • 22
  • 35
34
votes
2 answers

how can I override alias set in .bash_aliases

I like to use bash aliases to customize bash commands. Is there a way to override the bash alias settings, or should I rename the aliases to something different than the original command. eg: my .bash_aliases includes alias ls='ls -ltr' If I want…
David LeBauer
  • 31,011
  • 31
  • 115
  • 189
34
votes
3 answers

How do i invoke sc create from a powershell script

I want to invoke sc create from a powershell script. Here is the code. function Execute-Command { param([string]$Command, [switch]$ShowOutput=$True) echo $Command if ($ShowOutput) { Invoke-Expression $Command } else { …
gyozo kudor
  • 6,284
  • 10
  • 53
  • 80
34
votes
2 answers

how to serve html files in nginx without showing the extension in this alias setup

I'm having a lot of trouble setting up this alias inside nginx to display my website correctly. The website I'm concerned with should be accessible from mywebsite.com/mr and is different from the site located at mywebsite.com/. The website is…
askmike
  • 1,900
  • 4
  • 21
  • 27
34
votes
2 answers

Git aliases - command line autocompletion of branch names

If I run a regular git command such as git checkout I get helpful autocompletion of branch names when hitting the tab key. I have a few git aliases which take branch names as parameters, and I'm wondering if there's a way of getting the branch name…
bcmcfc
  • 25,966
  • 29
  • 109
  • 181
33
votes
2 answers

Renaming namespaces

I've been doing C++ for a long time now but I just faced a question this morning to which I couldn't give an answer: "Is it possible to create aliases for namespaces in C++ ?" Let me give an example. Let's say I had the following header: namespace…
ereOn
  • 53,676
  • 39
  • 161
  • 238
33
votes
6 answers

How to alias a field or column in MySQL?

I'm trying to do something like this. But I get an unknown column error: SELECT SUM(field1 + field2) AS col1, col1 + field3 AS col3 from core Basically, I want to just use the alias so that I won't need to perform the operations performed earlier.…
user225269
  • 10,743
  • 69
  • 174
  • 251
33
votes
4 answers

SQL alias for SELECT statement

I would like to do something like (SELECT ... FROM ...) AS my_select WHERE id IN (SELECT MAX(id) FROM my_select GROUP BY name) Is it possible to somehow do the "AS my_select" part (i.e. assign an alias to a SELECT statement)? (Note: This is a…
Paul S.
  • 4,362
  • 10
  • 35
  • 52
32
votes
1 answer

Are symbolic links and aliases the same thing on OS X?

I have been trying to set up some symbolic links in the Terminal, and haven't been able to get them to work. In trying to find what I was doing wrong, I compared their function to the "create alias" button in the right click menu. My question is…
user793324
32
votes
5 answers

Lost keystore alias but have file and password used for alias

recently I added a new alias to my keystore to sign my app. Now I lost the new generated file with the alias, but remember the password and the alias name and have an older copy the file. Is there a way to recreate the alias using this things?
waronin3D
  • 325
  • 1
  • 3
  • 6
32
votes
5 answers

What is the difference between square brackets and single quotes for aliasing in SQL Server?

I have seen some people alias column names using single quotes eg: select orderID 'Order No' from orders and others use square brackets eg: select orderID [Order No] from orders I tend to use square brackets. Is there any preference/difference?
Free2Rhyme2k
  • 534
  • 1
  • 6
  • 15
32
votes
7 answers

Alias 403 Forbidden with Apache

I'm trying to create a folder named week7 and an html page named hello.html in that folder outside the document root and have it viewed through an Alias directive. I created a folder named week7 out of the Document Root. I chose this location for…
Yousif
  • 355
  • 1
  • 3
  • 8
32
votes
2 answers

Is it possible to make an alias for a module in Ruby?

In Python, you can set an alias for a module with 'as': import mymodule as mm But I can't seem to find an equivalent for ruby. I know that you can include rather than require a module, but this risks namespace collisions. Is there any equivalent…
Sean Mackesey
  • 10,701
  • 11
  • 40
  • 66