September 16, 2012
A couple of things.
OK, I though about it. My first though was modifying the syntax highlighting in .rc
files by using the following command in vim
.
:set syntax=sh
But then I realized that .rc
files are ment for configuration like ~/.bashrc
, so I renamed my module files bach to .sh
files. Either way they worked.
Of course, if you want to rename all the files in a directory you will probably need to use the following command.
for i in *; do mv $i ${i/%.rc/.sh}; done
Included bash scripts do not need to be set to executable and in you don't need to modify $PATH
to include another file. (Or at least you shouldn't. YMMV.) Interestingly enough, you don't need to put #!/bin/bash
at the top of the included files either.
As I stated earlier, the downside is there is more than one file now. The upside, the code looks more professional and works just as it would in some big 500+ line behemoth. It's a coding practice you should also consider. I mean, I'd like for new_c.sh
to use the same inc/std_new
file in the near future. And it is becoming more likely that new.sh
and new_c.sh
will be bundled into the same tarball package in the near future. Stay tuned.