The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to read terminal attributes using ioctl() Sreejesh.S High Level Programming 1 05-17-2008 01:56 PM
How to read lock terminal values in solaris pankajarora_12 UNIX for Dummies Questions & Answers 0 07-11-2006 10:31 AM
Plz Help : How to use write command to execute command on some other terminal Aashish UNIX for Dummies Questions & Answers 2 03-03-2006 12:25 PM
read from terminal rein Shell Programming and Scripting 1 10-21-2005 10:43 AM
Terminal Hungup at the time of read pkusumam Shell Programming and Scripting 1 11-30-2001 04:19 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-08-2007
munnu munnu is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 17
read terminal command

hi
how to read terminal command,
just i want to read all command which write on terminal
so please tell me any system call, api avilable in c for above purpose
  #2 (permalink)  
Old 01-08-2007
ramesh.jella ramesh.jella is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 22
do this

do you wanna of previous commands

which you run in terminal

for this type

history

i dont understand wether your problem about this or not

ignore if not
  #3 (permalink)  
Old 01-08-2007
munnu munnu is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 17
my problem is i want to create one file which store all command or which write on terminals (bad command) in day, for that i read console terminal

now clear problem ............?
  #4 (permalink)  
Old 01-08-2007
bssandilya bssandilya is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 3
chk this out

hi u can write a deamon proc in C to read all the command in the terminal.

use the "system" system call in the c program and redirect all the commands in the history to a file to analyse.writing a deamon allows u to do this in background.

system("history>test.$$);

include this in the code.

mail me if u have any concerns
  #5 (permalink)  
Old 01-08-2007
munnu munnu is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 17
system ("history >/root/txtx.txt");
not working,it run properly(create file txtx.txt ) but file doent contain any thing
  #6 (permalink)  
Old 01-11-2007
odys odys is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 59
My strange idea:
You can remove ~/.bash_history
and then place FIFO of that name:
mkfifo ~/.bash_history
and then run some program for reading and saving
all commands.

Or maybe you would like to use "script" command.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0