For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > October 2006 > Execute Unix commands from Perl script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Execute Unix commands from Perl script
PLearner

2006-10-06, 11:06 pm

Hi everyone,

Ps I'm new to Perl (but have been working on Unix for a while) and I'm trying to develop my skills by taking on a project . I am trying to create a perl script that when executed behaves like a Unix Shell, but I need help on how to capture user inputs and then run them as commands at the prompt.

For example , when the perl script is run and the user types ls ., I want to capture the ls, store it in a variable...say $input , and then run thelscommand so that all files listed in the current working directory are listed.


Kindly explain how to go about this to me as this is the foundation of the larger picture that I have in mind.

Thanks in advance.

NB. If you know any online resource that will help in this work, kindly let me know.
ls
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com