#!/usr/bin/python3
#=====================================================================================================
# execute a shell command, and print the output
#===================================================================================================== 
import sys
sys.path.insert(0,'/home/s/sultans/web/python/demo/etl/util')
import cmdExec                                                            #import module

print("Content-Type: text/html \n")                                       #http header (required for web)

#command =  'ls -lR ..'                                                   #command as a string
command  = ['ls', '-lR', '..']                                            #command as a list
#command =  'ls -l > /home/s/sultans/web/python/demo/data/output.txt'
#command = ['cat',  '/home/s/sultans/web/python/demo/data/output.txt']                            
output   = cmdExec.exec(command)                                          #execute the command
print(output)