Differences

This shows you the differences between two versions of the page.

Link to this comparison view

virtualisation:integrating-software [2018/07/18 15:14] (current)
preisig created
Line 1: Line 1:
 +===== Hello World in C =====
 +
 +  - First of all we need to install gcc: GNU Compiler Collection
 +  - At the beginning, update the packages by typing <​code>​ apt-get update </​code> ​
 +  - Subsequently install the compiler by typing <​code>​ apt-get install gcc </​code> ​  
 +  - Now create and open a .c file using nano editor <​code>​ nano hello.c </​code>​
 +  - Type following code: <code c hello.c >#​include <​stdio.h> ​
 +int main() ​
 +{
 + printf("​Hello World"​);​
 + return 0; 
 +}
 +</​code> ​
 +  - Save it using Ctrl + O (German keyboard: Strg + O)
 +  - Exit using Ctrl + X (German keyboard: Strg + X)
 +  - Compile the program using gcc <​code>​ gcc hello.c -o hello </​code>​
 +  - Type <​code>​ ls -l </​code>​
 +  - The created file has rights 644. Change it to 755 <​code>​ chmod 755 hello </​code>​
 +  - Type <​code>​ ./hello </​code>​ to run the program
 +
 +===== Hello World shell script =====
 +
 +  - Create and open file using nano editor <​code>​ nano helloBash </​code>​
 +  - Type following code: <code bash helloBash >   
 +#!/bin/bash
 +echo "Hello World"
 +</​code>​
 +  - Save it using Ctrl + O (German keyboard: Strg + O)
 +  - Exit using Ctrl + X (German keyboard: Strg + X)
 +  - Type <​code>​ ls -l </​code>​
 +  - The created file has rights 644. Change it to 755 <​code>​ chmod 755 helloBash </​code>​
 +  - Type <​code>​ ./helloBash </​code>​ to run the program
 +
 +
 +
 +
 +
 +===== Hello World in Python =====
 +
 +  - First of all we need to install Python
 +  - At the beginning, update the packages by typing <​code>​ apt-get update </​code> ​
 +  - Subsequently install Python by typing <​code>​ apt-get install python </​code>​
 +  - Create and open a .py file using nano editor <​code>​ nano helloPt.py </​code>​
 +  - Type following code: <code python helloPt.py>​ print "Hello World" </​code>​
 +  - Save it using Ctrl + O (German keyboard: Strg + O)
 +  - Exit using Ctrl + X (German keyboard: Strg + X)
 +  - Run the program using <​code>​ python helloPt.py </​code>​
 +