- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- How to redirect stdout of a command in perl script...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 01:21 AM
тАО03-19-2009 01:21 AM
How to redirect stdout of a command in perl script.
How to redirect an output generated by a command using perl in windows. ( As we do in shell scripts ls > ls.out ).
Here is my script.
$DIR="C:\\Documents and settings\\Administrator";
$COMMAND="srvinfo -ns";
# srvinfo is the command available in
# Windows2003 reskit. I have attached the
# command too.
Now need to execute the srvinfo -ns and redirect the o/p to a file called srvinfo.txt at the $DIR location.
Can you please guide me to complete this.
Thanks,
Regards,
Raghu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 01:47 AM
тАО03-19-2009 01:47 AM
Re: How to redirect stdout of a command in perl script.
a.bat
C:\Documents and settings\Administrator\srvinfo -ns > srv_log.txt
and just execute that a.bat file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 01:57 AM
тАО03-19-2009 01:57 AM
Re: How to redirect stdout of a command in perl script.
I need to use the above said infomation inside a perl script.
-Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 02:10 AM
тАО03-19-2009 02:10 AM
Re: How to redirect stdout of a command in perl script.
put the entire command in a text file , rename it to .bat file and execute it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 07:18 AM
тАО03-19-2009 07:18 AM
Re: How to redirect stdout of a command in perl script.
system("$COMMAND > $DIR\\srvinfo.txt");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 08:36 AM
тАО03-19-2009 08:36 AM
Re: How to redirect stdout of a command in perl script.
Since the section heading is scripting and languages, thought this is the right section, anyways Sorry for the inconvenience.
Tried the option. but it didn't work.
Thanks,
Raghu