Skip to contentSkip to conversation

compress output of `cd' when installing templates

PATCH In review Gang Chen 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

Gang Chen

author
#0 lore raw

PATCH 1/1 compress output of `cd' when installing templates

When CDPATH is set in Bash, cd' writes new working directory to stdout, which corrupts output of tar cf - .'.

---

 Makefile |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
templates/Makefile +1 -1
index 8f7f4fe..cb67489 100644
@@ -44,5 +44,5 @@ clean:
 
 install: all
 	$(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(template_dir))
-	(cd blt && $(TAR) cf - .) | \
+	(cd blt > /dev/null && $(TAR) cf - .) | \
 	(cd $(call shellquote,$(DESTDIR)$(template_dir)) && $(TAR) xf -)
Signature · 1 line
If it makes you happy, it can't be that bad.
#1 lore raw
Quoted 2 lines · Gang Chen

When CDPATH is set in Bash, cd' writes new working directory to stdout, which corrupts output of tar cf - .'.

Fix bash instead, or just don't export CDPATH. It is used by bash only so exporting it is unnecessary.

Signature · 1 line
http://onion.dynserv.net/~timo/
#2 lore raw
Quoted 7 lines · Timo Hirvonen
Quoted 2 lines · Gang Chen

When CDPATH is set in Bash, cd' writes new working directory to stdout, which corrupts output of tar cf - .'.

Fix bash instead, or just don't export CDPATH. It is used by bash only so exporting it is unnecessary.

Thanks.

It is not just unnecessary, but "export CDPATH" anywhere in your rc scripts is actively *WRONG*.