Reply to message «script to download scripts from vim.org», sent 19:17:06 17 March 2011, Thursday by Amit Agarwal:
Some notes:
1. «grep pat1 | grep pat2 | sed 's/pat3/repl/g'» can be replaced with a single
«sed '/pat1/! d; /pat2/! d; s/pat3/repl/g'».
2. Most tr calls can also be merged into sed command.
3. The whole
tr -d '\001'-'\011''\013''\014''\016'-'\037''\200'-'\377'
can be replaced with
trd="tr -d '\\001-\\011\\013\\014\\016-\\037\\200-\\377'"
$trd
You don't need so many quotes and as it is widely used the you should either
put
it into function or use a variable.
4. Why are you using menu with `read read_choice' (and other reads) and not
command-line options? It reminds me of the time when I learned programming at
school and wrote programs with scanf() where now I use getopt.
5. I would have used perl for it. And no HTML regex parsing!!!
6. Code should be put under VCS if you want someone to help you. For simple
code
snippets there are gists on github, but I'd used fully-featured repositories on
bitbucket (not because github does not have ones alongside with gists, but
because I don't like git. On bitbucket gist request has status open and is two
years old).
Original message:
> Hi All,
>
> I have written a script to download scripts for vim directly from the
> www.vim.org site.
> Please find a link to the same :
> http://blog.amit-agarwal.co.in/2011/03/09/all-in-one-solution-for-all-the-s
> cripts-of-vim-from-vim-org/
>
> I would like to put that on www.vim.org site, if that is possible.
> Please help me with your comments and reviews and if you think this will
> be helpful for the vim users.
signature.asc
Description: This is a digitally signed message part.
