From 857a7ef48eccb79efe14cb37c7b73ad27cf47e7c Mon Sep 17 00:00:00 2001 From: arcan1s Date: Fri, 24 Jan 2014 21:33:23 +0400 Subject: [PATCH] small edit of zshrc --- _posts/2014-01-14-about-zshrc.html | 12 ++++++------ ru/_posts/2014-01-14-about-zshrc.html | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/_posts/2014-01-14-about-zshrc.html b/_posts/2014-01-14-about-zshrc.html index bbc4652..231bda8 100644 --- a/_posts/2014-01-14-about-zshrc.html +++ b/_posts/2014-01-14-about-zshrc.html @@ -407,13 +407,13 @@ pack () {

Here is a special function for su:

{% highlight bash %} su () { - checksu=0 - for flags in $*; do - if [[ $flags == "-" ]]; then - checksu=1 - fi + CHECKSU=0 + for FLAG in $*; do + [[ $FLAG == "-" ]] && CHECKSU=1 + [[ $FLAG == "-l" ]] && CHECKSU=1 + [[ $FLAG == "--login" ]] && CHECKSU=1 done - if [[ $checksu == 0 ]]; then + if [[ $CHECKSU == 0 ]]; then echo "Use 'su -', Luke" /usr/bin/su - $* else diff --git a/ru/_posts/2014-01-14-about-zshrc.html b/ru/_posts/2014-01-14-about-zshrc.html index acfca42..9b7fee8 100644 --- a/ru/_posts/2014-01-14-about-zshrc.html +++ b/ru/_posts/2014-01-14-about-zshrc.html @@ -407,13 +407,13 @@ pack () {

Специальная функция для su:

{% highlight bash %} su () { - checksu=0 - for flags in $*; do - if [[ $flags == "-" ]]; then - checksu=1 - fi + CHECKSU=0 + for FLAG in $*; do + [[ $FLAG == "-" ]] && CHECKSU=1 + [[ $FLAG == "-l" ]] && CHECKSU=1 + [[ $FLAG == "--login" ]] && CHECKSU=1 done - if [[ $checksu == 0 ]]; then + if [[ $CHECKSU == 0 ]]; then echo "Use 'su -', Luke" /usr/bin/su - $* else