Bash completion is a very good feature in Bash. We are able to complete filenames, just by pressing <TAB>. I had downloaded a YouTube video related to Tsar Bomba. Since YouTube videos are Flash Video files (.flv), I was not able to complete their filenames by pressing <TAB> in the terminal when trying to invoke mplayer.
A quick inspection of /etc/bash_completion solved the problem.
In mplayer(1) completion section,
_filedir '@(mp?(e)g|MP?(E)G|wm[av]|WM[AV]|avi
|AVI|asf|ASF|vob|VOB|bin|BIN|dat|DAT|vcd|VCD|ps
|PS|pes|PES|fli|FLI|viv|VIV|rm?(j)|RM?(J)|ra?(m)|RA?
(M)|yuv|YUV|mov|MOV|qt|QT|mp[34]|MP[34]|og[gm]|OG[GM]
|wav|WAV|dump|DUMP|mkv|MKV|m4a|M4A|aac|AAC|m2v|M2V|dv
|DV|rmvb|RMVB|mid|MID|ts|TS|3gp|mpc|MPC|flac|FLAC|flv)'
flv was appended at the end. That was it. Problem solved! Happy viewing!
Thursday, October 30, 2008
Bash Completion
Posted by Alan Haggai Alavi at 10:59 AM
Labels: bash, bash completion
Subscribe to:
Post Comments (Atom)


0 comments:
Post a Comment