Skip to main content

New answers tagged

5 votes
Accepted

how to alias the `history` function in fish shell

Two things are happening here: fish's alias actually creates a function. fish ships with a default history function already. So when you write alias history "PAGER='bat -l fish' history" ...
glenn jackman's user avatar
1 vote

how to alias the `history` function in fish shell

I succeeded using functions -c to copy the built-in history function. Turns out alias was just creating an history function that calls itself, while functions -c fully copies the function. functions -...
matan h's user avatar
  • 135
1 vote
Accepted

How to escape both single quotes and exclamation marks in bash

! is only a problem for history expansion. History expansion only happens in interactive shells (when not disabled altogether by the user like I do) and in bash (like in zsh, but contrary to csh where ...
Stéphane Chazelas's user avatar
0 votes

How to escape both single quotes and exclamation marks in bash

Storing the password in your alias might pose security implications. I would suggest you to use a function and have the password parametrized as follows. For example ldap_search() { local password=...
Valentin Bajrami's user avatar
1 vote

Run a command that is shadowed by an alias

One way that should be portable and independent of a shell type is to use env: env - run a program in a modified environment SYNOPSIS env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...] So ...
Petr's user avatar
  • 1,674

Top 50 recent answers are included