EvanK has asked for the wisdom of the Perl Monks concerning the following question:
but i need to enter specific commands INTO the shell before the user can enter anything themselves...this may take an OS-dependant trick, but thats ok because im only using this on the one specific OS (debian 3.1).system("./SHELL"); print "by the time you see this, you'll have exited the shell";
i figured it needs to be something along the lines of the following, but these dont quite work:
perhaps i need to somehow drop commands into the terminal's input buffer before i invoke the app? i wouldnt even know where to begin to do that though.#invokes SHELL, then waits until termination of console #to call CMD...not what i need system("./SHELL\nCMD\n"); #invokes the SHELL, enters command into SHELL, #then terminates SHELL before user can do anything system("./SHELL<<EOC\nCMD\nEOC\n");
__________
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
- Terry Pratchett
|
|---|