FINALLY! SOME UPDATES! This website is being reconstructed. Some content will go away soon. If you want to see my new stuff, visit my github: https://github.com/jrcharney/.

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.


source inc/man_new.rc                   # contains the manual help data
source inc/std_new.rc                   # contains the functions all the other modules use
source inc/new_headers.rc               # contains the compose_headers functions
source inc/new_includes.rc              # contains the compose_includes functions
source inc/new_bodies.rc                # contains the compose_body and compose_footer functions

Just a preview of inside new.sh v3.0a where all the new source are.

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.

Tags

Under Construction