Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^3: No command window output when running script

by syphilis (Chancellor)
on Dec 29, 2012 at 23:26 UTC ( #1010859=note: print w/replies, xml ) Need Help??

in reply to Re^2: No command window output when running script
in thread No command window output when running script

Cd doesn't return a value so nothing is output with this example

Interesting ... and there's probably a good reason for that, but I don't know what it is.
Certainly, the behaviour you're seeing doesn't conform to the documentation I get for cd, which begins with:
C:\_32\C>cd /? Displays the name of or changes the current directory. CHDIR [/D] [drive:][path] CHDIR [..] CD [/D] [drive:][path] CD [..] .. Specifies that you want to change to the parent directory. Type CD drive: to display the current directory in the specified drive +. Type CD without parameters to display the current drive and directory. .....
Perhaps you're running in a different shell (I use cmd.exe), or perhaps your cmd.exe shell finds a different 'cd' implementation to run.
To force your cmd.exe shell to use its own implementation, I think you just need to involve a shell metacharacter in the command - eg:
cd <nul
Does that command print out the current directory for you ?

(Admittedly this has nothing to do with the subject you initially raised ... but I find it a little bit interesting.)


Replies are listed 'Best First'.
Re^4: No command window output when running script
by JennieInMI (Acolyte) on Dec 30, 2012 at 01:33 UTC

    Hi Rob,

    I apologize. My error. I do run cmd.exe and just reran your code example. cd was, indeed, returning a value. However, since the returned value looked exactly like the command prompt only minus the > sign I just didn't realize that it wasn't the command prompt. I'm not generally dense. I don't know what's wrong with me here lately. Anyway, your example was fine. I just messed up reviewing the result. Thank you again for the answer.



    After messing around with the syntax a little I did finally get it to work at the command line. Thanks again Rob.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010859]
[LanX]: yep
[erix]: or Ctrl-U to view current html :P
[LanX]: name not id
[LanX]: id isn't approved AFAIK
[LanX]: name works
erix feels silly for having actually tested that contiguous values make no difference in CLUSTERing a table (At least, in postges)
[LanX]: Perl Monks Approved HTML tags
[LanX]: erix and his postguess ...
[erix]: (Grrres...)
[dabella12]: I have a problem install tK on CeontOs using perl 5.24

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-06-24 13:32 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (557 votes). Check out past polls.