Bash commands tail fails to produce output in python
Question: 
    #!/usr/bin/env bash
    

I am working on using bash commands in python I found this example in Red hat
magazine the tail command does not produce any output. I would like to
understand why it is failing and I have also tried to import subprocess but
that just hangs.

    
    
    #Create Commands**strong text**
    SPACE=`df -h`
    MESSAGES=`tail /var/log/messages`
    
    #Assign to an array(list in Python)
    cmds=("$MESSAGES" "$SPACE")
    
    #iteration loop
    count=0
    for cmd in "${cmds[@]}"; do
        count=$((count + 1))
        printf "Running Command Number %s \n" $count
        echo "$cmd"
    done
    


Answer: Printing the command doesn't mean executing it. Look at Python's
[subprocess](http://docs.python.org/2/library/subprocess.html) library for API
and examples for doing what you want.

