Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:handbook:development [2010/07/08 15:14] – external edit 127.0.0.1 | en:handbook:development [2016/10/24 14:24] (current) – IDE Geany replaced by Beaver hgt | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| === Create a SHell script === | === Create a SHell script === | ||
| - | Before starting a new SHell script, you must pay attention to the interpreter used. Most SHell scripts use /// | + | Before starting a new SHell script, you must pay attention to the interpreter used. Most SHell scripts use /// |
| < | < | ||
| Line 17: | Line 17: | ||
| </ | </ | ||
| - | Now that you have a new executable file, you can edit it. You can continue to stay in the terminal and use the Nano editor (Ctrl + x to save & exit) or IDE Geany to edit: | + | Now that you have a new executable file, you can edit it. You can continue to stay in the terminal and use the Nano editor (Ctrl + x to save & exit) or IDE Beaver |
| < | < | ||
| $ nano script.sh | $ nano script.sh | ||
| Or : | Or : | ||
| - | | + | |
| </ | </ | ||
| Here's a script that contains a variable NAME and displays the value with the echo command: | Here's a script that contains a variable NAME and displays the value with the echo command: | ||
| - | <code> | + | <file> |
| #!/bin/sh | #!/bin/sh | ||
| Line 33: | Line 33: | ||
| echo "$NAME is nice." | echo "$NAME is nice." | ||
| - | </code> | + | </file> |
| Once you have created/ | Once you have created/ | ||
| Line 48: | Line 48: | ||
| | | ||
| - | You can find plenty of example scripts in the ///sample// directory inside the source code of dialog, which can be downloaded from: http:// | + | You can find plenty of example scripts in the ///sample// directory inside the source code of dialog which can be downloaded from: http:// |
| < | < | ||
| Line 54: | Line 54: | ||
| </ | </ | ||
| - | ===== Geany IDE ===== | + | ===== Beaver |
| - | Geany is an IDE or Integrated Development Environment. Geany is simple, | + | Beaver |
| - | === Launch Geany === | + | < |
| - | You will find Geany in the //menu --> Development --> Geany//. Once launched for the first time, you can adjust your preferences via Edit --> Preferences. You can also launch Geany via a terminal: | + | ===== Geany IDE===== |
| - | < | + | Geany is an IDE, or Integrated Development Environment. It is a simple, small and lightweight application, |
| - | Note when compiling | + | ==== Executing Geany ==== |
| + | |||
| + | You can install Geany: | ||
| + | |||
| + | < | ||
| + | |||
| + | After it runs for the first time, you can set your preferences through the menu //Edit// --> // | ||
| + | |||
| + | < | ||
| + | |||
| + | Note: when compiling source code, the //./configure// script offers the // | ||
| ===== Perl or Microperl - Code/use Perl scripts ===== | ===== Perl or Microperl - Code/use Perl scripts ===== | ||
| - | On SliTaz you can use the powerful scripting language Perl via the perl or microperl binary. Microperl is a streamlined version of perl - compiled from official sources, Perl scripts running Microperl are compatible with the complete version of Perl. One of Perl's strengths is its portability, | + | On SliTaz you can use the powerful scripting language Perl via the perl or microperl binary. Microperl is a streamlined version of perl compiled from official sources, Perl scripts running Microperl are compatible with the complete version of Perl. One of Perl's strengths is its portability, |
| < | < | ||
| Line 78: | Line 88: | ||
| === Hello world! === | === Hello world! === | ||
| - | The purpose of this script is to display Hello World. You can start by creating the file and making it executable on the command line and then editing with IDE Geany. Note the script is called hello.pl, but you can name it as you see fit, with or without the .pl extension: | + | The purpose of this script is to display Hello World. You can start by creating the file and making it executable on the command line and then editing with Beaver. Note the script is called hello.pl, but you can name it as you see fit, with or without the .pl extension: |
| < | < | ||
| $ touch hello.pl | $ touch hello.pl | ||
| $ chmod +x hello.pl | $ chmod +x hello.pl | ||
| - | | + | |
| </ | </ | ||
| The first line of a Perl script begins by defining the path to the Perl interpreter, | The first line of a Perl script begins by defining the path to the Perl interpreter, | ||
| - | <code> | + | <file> |
| # | # | ||
| # | # | ||
| Line 94: | Line 104: | ||
| print "Hello World!\n"; | print "Hello World!\n"; | ||
| - | </code> | + | </file> |
| To execute and test the script: | To execute and test the script: | ||
| Line 103: | Line 113: | ||
| CGI scripts are designed to display dynamically generated web pages. The Perl language associated with the LightTPD web server allows you to use CGI scripts through your public space or via virtual hosts. Perl is quite adapted to Web 2.0 and can generate xHTML pages. On SliTaz you must have Perl or Microperl installed and the LightTPD server configured before you can use CGI scripts coded in Perl. Note that by default SHell scripts (.sh) can be placed in /cgi-bin/. | CGI scripts are designed to display dynamically generated web pages. The Perl language associated with the LightTPD web server allows you to use CGI scripts through your public space or via virtual hosts. Perl is quite adapted to Web 2.0 and can generate xHTML pages. On SliTaz you must have Perl or Microperl installed and the LightTPD server configured before you can use CGI scripts coded in Perl. Note that by default SHell scripts (.sh) can be placed in /cgi-bin/. | ||
| - | Once the server is properly configured, you can put your CGI in your // | + | Once the server is properly configured, you can put your CGI in your // |
| - | <code> | + | <file> |
| # | # | ||
| # | # | ||
| Line 111: | Line 121: | ||
| print "Hello World!\n"; | print "Hello World!\n"; | ||
| - | </code> | + | </file> |
| ===== Python ===== | ===== Python ===== | ||
| Line 127: | Line 137: | ||
| ===== Toolchain - Libraries, C compiler and tools ===== | ===== Toolchain - Libraries, C compiler and tools ===== | ||
| - | To compile software from sources or your own code, you need at least the basic toolchain, comprising of Binutils, Glibc, C compiler, Kernel headers and the Make utility. Note that the toolchain is used by the SliTaz developers to compile the entire system from source. To install the meta package and all dependancies: | + | To compile software from sources or your own code, you need at least the basic toolchain, comprising of Binutils, Glibc, C compiler, Kernel headers and the Make utility. Note that the toolchain is used by the SliTaz developers to compile the entire system from source. To install the meta package and all dependencies: |
| < | < | ||
| Line 135: | Line 145: | ||
| < | < | ||
| - | If you would like to compile applications utilizing the Ncurses library, you must install the ncurses-dev package. Note the ncurses package also provides a variety of small programs such as tic or tack: | + | If you would like to compile applications utilizing the Ncurses library, you must install the ncurses-dev package. Note the ncurses package also provides a variety of small programs such as tic or tac: |
| < | < | ||