Inline downloadable scripts

From FBSD_tips

Jump to: navigation, search

I wanted to be able to

  • keep copies of scripts separate from the pages describing them
  • display them inline in the article describing them
  • download them directly to file and run them

Media wiki can do this (w00t!)

1) create the script article, i use the name of the script including the '.sh' e.g.

Key_machine.sh

2) put the script in the referring article like this

{{:Key_machine.sh}}

3) set up a download command by clicking on edit for the script article and replacing the action=edit with action=raw. Remember to escape special shell characters.

curl --output key_machine.sh http://bsdtips.utcorp.net/mediawiki/index.php\?title=Key_machine.sh\&action=raw

4) edit it here : Key_machine.sh

Personal tools