Small tweek to Stackscript 1 goodstuff function
Stackscript 1 has a "goodstuff" function which makes a few nice changes to the .bashrc:
sed -i -e 's/^#PS1=/PS1=/' /root/.bashrc # enable the colorful root bash prompt
sed -i -e "s/^#alias ll='ls -l'/alias ll='ls -al'/" /root/.bashrc # enable ll list long alias <3
I noticed the script failed on my default .bashrc cause it contained a space after the comment hash:
# PS1='\u@\h:\w\$ '
# alias ll='ls -l'
I'm not a very experienced shell scripter, but I think a simple update to the regex will ignore any spaces between the comment mark and the start of the commands which will allow the function to work on both cases:
sed -e 's/^ *#PS1=/PS1=/' bashrc
sed -e "s/^ *#alias ll='ls -l'/alias ll='ls -al'/" bashrc
Thanks,
Phil