From: Chris Koeritz Date: Mon, 18 Dec 2017 21:33:56 +0000 (-0500) Subject: added option to change listing form of summing dir X-Git-Tag: 2.140.106^2~4 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=b87a9a0b0909c947d2b7e5e85b3cb8464949ff53 added option to change listing form of summing dir and added a macro ll to capitalize on that. it is just like l or dir, but also shows dot files. --- diff --git a/scripts/core/common.alias b/scripts/core/common.alias index 87e47676..ba2e44be 100644 --- a/scripts/core/common.alias +++ b/scripts/core/common.alias @@ -58,6 +58,7 @@ define_yeti_alias fix_ssh_perms='chmod 700 $HOME/.ssh ; chmod 600 $HOME/.ssh/*' define_yeti_alias halt='sudo shutdown -h now' define_yeti_alias i=inventory define_yeti_alias l='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl' +define_yeti_alias ll='ls_dot_add=-a perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl' define_yeti_alias ls='ls -HhFC $color_add' define_yeti_alias lsd='ls -hl' define_yeti_alias md='mkdir' diff --git a/scripts/files/summing_dir.pl b/scripts/files/summing_dir.pl index 10604659..82f4d29e 100644 --- a/scripts/files/summing_dir.pl +++ b/scripts/files/summing_dir.pl @@ -20,7 +20,7 @@ require "filename_helper.pl"; -use Env qw($TMP $color_add $TERM); +use Env qw($TMP $color_add $ls_dot_add $TERM); local($chewed_line) = ""; local(@arg_list); @@ -37,6 +37,8 @@ if ($#ARGV < 0) { @arg_list = &glob_list(@ARGV); } +# add parameters to our chewed_line, but skip items if they are flags we don't +# implement. foreach $dir (@arg_list) { if ($dir eq "-al") { next; } # skip ls directives. if ($dir eq "-l") { next; } # skip ls directives. @@ -56,8 +58,8 @@ chop($temp_file); # drop the main payload, the list of directory info, but also save that # info to a file for analysis. -system("ls -HhlF $color_add $chewed_line"); -system("ls -HhlF $color_add $chewed_line > $temp_file"); +system("ls -HhlF $ls_dot_add $color_add $chewed_line"); +system("ls -HhlF $ls_dot_add $color_add $chewed_line > $temp_file"); # the color_add variable, if defined, will have flags for setting the # directory listing color scheme.