I need some suggestion on glob function.
I am trying to write a python program to grep some specific files in a particular directory.
In the directory i have some files like below
in this directory i need to grep onlu my hostname files, my host name is abc, so the output should be
I have written the program as below
- Code: Select all
import os, re, tty, sys, termios, glob, subprocess, time, socket
userhome = os.getenv( 'HOME')
host = socket.gethostname()
host_files = glob.glob(-------) ##here I got struck.
Please help me how to fill glob.glob line in the above coding