diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-09-16 15:55:47 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-09-16 16:14:09 -0400 |
commit | 571a1d67829295ee82f4988788f77c615caa5f92 (patch) | |
tree | be7173a883b1af4a028c6da16895836028b92816 /bin | |
parent | 8f7459d04b6e168937c527c9e4e5ce904b7b891b (diff) | |
download | conf-571a1d67829295ee82f4988788f77c615caa5f92.tar.gz conf-571a1d67829295ee82f4988788f77c615caa5f92.zip |
fallback for unreliable env
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fancy-prompt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/fancy-prompt b/bin/fancy-prompt index 18bc951..4927951 100755 --- a/bin/fancy-prompt +++ b/bin/fancy-prompt @@ -13,8 +13,8 @@ if ($ARGV[0] eq '--prompt-escape') { # collect information chomp(my $hostname = `hostname`); my $cols = `tput cols`; -my $pwd = $ENV{PWD}; -my $user = $ENV{USER}; +my $pwd = $ENV{PWD} // '???'; +my $user = $ENV{USER} // '???'; my $root = ($> == 0); (my $time = localtime) =~ s/.*(\d\d:\d\d:\d\d).*/$1/; my $err = $ARGV[0] || 0; # bash's $? is passed on the command line |