From dfdc10bcf3bb4337130a059e040ba8095a48f127 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 7 Feb 2017 09:47:26 -0500 Subject: [PATCH] fixed ls colors --- scripts/core/generate_aliases.pl | 12 ++++++------ scripts/core/variables.sh | 13 +++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/scripts/core/generate_aliases.pl b/scripts/core/generate_aliases.pl index 775a1719..50e4bd56 100644 --- a/scripts/core/generate_aliases.pl +++ b/scripts/core/generate_aliases.pl @@ -91,7 +91,7 @@ sub rebuild_script_aliases { } # test if we can use color in ls... - $test_color=` ls --help 2>&1 | grep -i color `; +# $test_color=` ls --help 2>&1 | grep -i color `; # this is an array of files from which to draw alias definitions. @ALIAS_DEFINITION_FILES = ("$FEISTY_MEOW_SCRIPTS/core/common.alias"); @@ -126,11 +126,11 @@ sub rebuild_script_aliases { print GENOUT "## please do not edit.\n"; print GENOUT "##\n"; - if (length($test_color)) { - print GENOUT "export color_add=--color=auto\n"; - } else { - print GENOUT "export color_add=\n"; - } +# if (length($test_color)) { +# print GENOUT "export color_add='--color=auto'\n"; +# } else { +# print GENOUT "export color_add=\n"; +# } # plow in the full set of aliases into the file. foreach $i (@ALIAS_DEFINITION_FILES) { diff --git a/scripts/core/variables.sh b/scripts/core/variables.sh index 9cecadf8..b3119ae5 100644 --- a/scripts/core/variables.sh +++ b/scripts/core/variables.sh @@ -130,7 +130,20 @@ if [ -z "$CORE_VARIABLES_LOADED" ]; then fi ############## + + # set up the color_add variable which is a flag that lets ls know colors work. + + # test if we can use color in ls... + ls --help 2>&1 | grep -i -q color + if [ $? -eq 0 ]; then + export color_add='--color=auto' + else + export color_add= + fi + unset test_ls_colors + ############## + # umask sets a permission mask for all file creations. # this mask disallows writes by "group" and "others". umask 022 -- 2.34.1