[Tutor] Referencing a string

Alan Gauld alan.gauld at blueyonder.co.uk
Sun Sep 14 23:50:59 EDT 2003


The code is like this.
> cmd = "grep -c pattern " + 'filelist3' + " > " + 'grepdata'
> os.system(cmd)

Move pattern outside the quotes:

cmd = "grep -c " + pattern + " " + filelist3 + " > " + 'grepdata'

I'm assuming filelist3 is also a variable?

Alan G



More information about the Tutor mailing list