![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Guest | Re: Command substitution Ah... I did misunderstand your statement. What you want should be even easier myscript.py (ls * | %{$_.fullname}) Brandon Shell [MVP] ------------------------ Blog: http://www.bsonposh.com/ Author: http://www.TurboChargeAD.org Profile: https://mvp.support.microsoft.com/profile/Brandon K> Thank for the link, which is interesting reading, however I don't K> think it solves my problem. I get an error when I try to follow your K> example: K> Quote: Quote: >> set f=ls * >> myscript.py "\\%f%" K> File "myscript.py", line 74, in <module> K> lines = open(fname, "r").readlines() K> IOError: [Errno 2] No such file or directory: '\\\\ls *' K> So, you see that the literal string "ls *" is passed as an argument, K> not the expanded list of files. Yes, the script is in python, so I K> will probably jsut modify it to accept globs. I was hoping, however, K> that Windows will allow me to somehow substitute the command and do a K> fancy one-liner. K> K> Cheers, K> Karol K> On Jan 8, 3:33 pm, Brandon Shell [MVP] <a_bshell.m...@xxxxxx> K> wrote: K> Quote: Quote: >> I have a blog post that shows an example of what your looking for "I >> think." >> >> http://bsonposh.com/archives/236 >> >> K> Hi, >> K> >> K> I'm wondering how can I substitute the outcome of one command in >> K> another without using for? That is, I want to evaluate one command >> K> and pass the outcome as an argument to some other command, or >> script. >> K> >> K> Under bash (in linux) this would be simply, for example: >> K> >> K> ./myscript `ls *.cpp` >> K> >> K> I cannot find any information on how to do this in an equally >> simple >> K> fashion. >> K> >> K> Thanks for any help, >> K> Karol |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Running a command from inside a script, command line is corrupted | PowerShell | |||
| What is the command line command for unzipping files? | Vista General | |||
| How to perform variable substitution in powershell? | PowerShell | |||
| Command & variable substitution | PowerShell | |||
| Stumped by variable substitution | PowerShell | |||