Linux / UNIX Tech Support Forum
This is a discussion on How to Redirect OutPut of Shell Command to a text file within the Shell scripting forums, part of the Development/Scripting category; Hi, I m working on Solaris 10 and want to redirect the output of the command to text file using ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi, I m working on Solaris 10 and want to redirect the output of the command to text file using C++
I wanna to write prstat command to file using c++ main() { System("prstat -t > fileName.txt"); } but it does not work.. Kindly help me Regards: Hadi |
| Sponsored Links | ||
|
|
|
||||
|
Try the following format:
Code:
command &>/path/to/logfile command > /path/to/logfile 2>&1 Code:
main()
{
System("prstat -t ");
}
Code:
./a.out > output.txt ./a.out &>output.txt
__________________
Vivek Gite Linux Evangelist Last edited by nixcraft; 29-04-2009 at 07:31 PM. |
![]() |
| Tags |
| c++ , c++ redirect output , g++ , shell redirect output , solaris , unix |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| print a "FTP dir command" output into a .txt file | ecompean | Shell scripting | 2 | 09-02-2009 11:34 PM |
| how to display text when no output is available | sidebrake | Shell scripting | 3 | 29-10-2008 12:44 PM |
| text output to mysql | chebbab | Shell scripting | 4 | 26-11-2007 07:29 PM |
| How to redirect Output | puppen | Shell scripting | 15 | 06-12-2006 08:44 PM |
| How can I redirect the output of time command to file | warren | Linux software | 13 | 25-08-2006 11:17 AM |