Tag Info

New answers tagged

0

Don't use alias. Use a shell function. Like this function sysctl_start { systemctl start "$1" && echo SUCCESS || echo FAILURE } or even better function sysctl_start { systemctl start "$1" systemctl status "$1" } If you want just special handling for start, but keep the name, write a wrapper function systemctl { if [ "$2" = ...


0

Your bash-completion isn't really "corrupted" - this is simply a known bug with bash-completion 2.1 and Bash 4.3. I recently answered a related question over at AskUbuntu and then again right here, but since I'm at it I'll also answer here so that people googling for this problem will find the answer here too. I gave more details over at AskUbuntu, but ...


1

As I remember alias can't use variables inside of it - so use function instead. function sshserv { gnome-terminal --tab --command " bash -c 'ssh root@$1 \"bash -rcfile .my_bashrc\"'" } and use as sshserv server1


1

count_glob() { [ -e "$1" ] echo "($v=$((!$?*$#)))+" } You could declare a function like the above. Then instead of ls and the rest you could just do... ...Currently in: $(($( v=c count_glob * v=h count_glob .* )-2)) entries and $((h-2)) are hidden... I only removed the escape sequences because they're not relevant here - it will work ...


4

Another option is to use a link: ln -s my_config/my_inputrc .inputrc That will create the file .inputrc as a link pointing to my_config/my_inputrc.


4

If you only want to change the location of the file, you can set INPUTRC to my_config/my_actual_inputrc (if unset, defaults to ~/.inputrc). There is also an equivalent of source, that is $include (source). For example: $include myconfig/my_actual_inputrc


8

According to man readline: $include This directive takes a single filename as an argument and reads commands and bindings from that file. For example, the following directive would read /etc/inputrc: $include /etc/inputrc


0

Historical compatibility because early versions of Unix used paths such as //host/path. From the bash FAQ: E10) Why does cd //' leave $PWD as//'? POSIX.2, in its description of `cd', says that three or more leading slashes may be replaced with a single slash when canonicalizing the current working directory. This is, I presume, for ...


0

cd // = Change the shell working directory to the root directoy


0

Here is my solution: PATH=$(echo -n $PATH | awk -v RS=: -v ORS=: '!x[$0]++' | sed "s/\(.*\).\{1\}/\1/") A nice easy one liner that does not leave a trailing :



Top 50 recent answers are included