[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bash crashed in a alias to view markdown



Hello guys,

This alias caused bash to crash:

http://sprunge.us/PMhe

The alias is now corrected to check if `$1` is empty (*), but still, bash should not crash like this.

I'm not opening a bug report because I don't really know (nor have the time to find out) how/where this things are correlated. Anyway, I still think this information would be useful to those who are working closely to bash maintainers, so here it is, shared with you.

I hope this helps.

Thank you,
Beco.

PS. All I did was calling the alias without an argument (a file to open) and pressing CONTROL-C to interrupt it, twice in a row. And bang, crash.

(*) The new alias, in case someone finds it useful to view markdown files:

alias mdless='_mdless() { if [ -n "$1" ] ; then if [ -f "$1" ] ; then cat <(echo ".TH $1 7 `date --iso-8601` Dr.Beco Markdown") <(pandoc -t man $1 ) | groff -K utf8 -t -T utf8 -man 2>/dev/null | less ; fi ; fi ;}; _mdless '

Just add to your ~/.bash_aliases ;)



--
Dr Beco
A.I. researcher

"I know you think you understand what you thought I said but I'm not sure you realize that what you heard is not what I meant" -- Alan Greenspan

Creation date: pgp.mit.edu ID as of 2014-11-09

Reply to: