From b87a9a0b0909c947d2b7e5e85b3cb8464949ff53 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Mon, 18 Dec 2017 16:33:56 -0500 Subject: [PATCH] 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. --- scripts/core/common.alias | 1 + scripts/files/summing_dir.pl | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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. -- 2.34.1