Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exec ls $var*.exp

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi there!

I am working on a script that should list all the expectscript is a particular directory to the user, and then chose which one he/she wants to execute, and log the results etc in a log.

But, I have a problem with the exec command. The thing is that when I use the syntax "send user "[exec ls $dir$application*.exp]\n"" (or in tclsh " exec ls /home/eandost/automation/testcases/*") I get an error like "/home/eandost/automation/testcases/tss*.exp: No such file or directory". Is this a bug in the exec procedure, or have I just made an error somewhere? In that case, how do I make exec evaluate "*" as a regular expression instead of just the character "*"?

Or is there another way of doing this that works better?

thank you very much for your help
Yours, anders osterling
 
You should read the previous thread named: "executing 'cat' command from tcl script".
Avia explains well your problem: you need to use glob.

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top