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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hm... mabye it will be easier to un 1

Status
Not open for further replies.

andste

Technical User
May 9, 2003
6
SE
Hm... mabye it will be easier to understand if put it like this:

> set cmd {ls -al}

then I want to execute that command, but not using exec (since that doesnt work for my specific commands).

What's annoying is that ls -al works really fine if i type it in myself at the prompt. But i dosen't work if I do:

> set $cmd {ls -al}
> $cmd
 
ugg I just got what you are trying to say. Thats a pretty messed up problem, not sure why its happening. But I was able to get ls-al to run from my prompt but heres what i had to do:

>set cmd ls
>set option -al
>$cmd $option


what a pain
 
Please try eval.
This is a very common problem btw, and is usually handled
by eval like constructs in other languages too.

Code:
set cmd "ls -al"
eval $cmd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top