Saturday, February 15, 2014

Shell Script example

Example of shel script

Eg of C code

[devi@ram ~]$ cat mail.c
#include <stdio.h>

int main() {
      printf ("Hello World\n");
      return (0);
}
[devi@ram ~]$ gcc mail.c
[devi@ram ~]$ ./a.out
Hello World

eg of shell script
[devi@ram ~]$ cat greet.sh
#!/bin/sh
# Author:
# It displays the "Hello World"
#
echo "Hello World !!!"

[devi@ram ~]$ sh greet.sh
Hello World !!!


No comments:

Post a Comment