expanding a variable

Jonathan Soons jsoons at juilliard.edu
Thu Mar 22 22:05:13 CET 2001

I am trying to give my cv group (who all have logins like cv???.)
all the same .profile. The variable in the last line of the script
doesn't seem to be expanding, even though this is very similar to
an example in "Core Python Progr..."

d = commands.getoutput('ls /u')
dirs = string.split(d, '\n')
for dir in dirs:
    if re.search('^cv', dir):
        os.system('cp  /u/test/.profile /u/dir/')

Should I stick to bash for this kind of thing?
Thanks for any advice.

More information about the Python-list mailing list