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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passing Filename as a Parameter to Another script ravisg Shell Programming and Scripting 1 05-07-2008 11:28 PM
shortcut for tar cvf - [filename] | gzip > [filename].tar.gz bcamp1973 UNIX for Dummies Questions & Answers 4 12-11-2007 05:45 PM
script to change filename with numbers silversurfer202 Shell Programming and Scripting 5 11-10-2006 10:13 AM
read a part of filename from the list in the script happyv Shell Programming and Scripting 3 10-20-2006 09:58 AM
How to send filename as variable in a shell script gthokala9 Shell Programming and Scripting 6 06-27-2006 01:23 PM

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 09-11-2006
charbel charbel is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 41
script -a filename

Dear All,

I have a small question but the answer might not be small

I am using the following command "script -a filename" to record commands executed by user.
As you know, the above command will print all what appears on the screen (commands and their output) to the filename.

Is there a way, to print to the filename only the commands without the output of these commands???

Appreciate your help.
  #2 (permalink)  
Old 09-11-2006
Raom Raom is offline
Registered User
  
 

Join Date: Sep 2005
Location: india
Posts: 79
well u have .sh_history file.
  #3 (permalink)  
Old 09-11-2006
Hitori's Avatar
Hitori Hitori is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2006
Posts: 360
.history file names may differ depending on your shell (e.g. .bash_history)
  #4 (permalink)  
Old 09-17-2006
charbel charbel is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 41
I understand what you have said but the .sh_history stores all commands entered by all users (i.e. its the shell history and not the user history). What i am looking for here is the user history.

The command i have mentioned eralier ( script -a filename) stores all the commands entered by the user who have looged into the system and the utput file which includes these commands will be saved once the session is terminated ot user logged out. The problem is that the above command will print the commands entered by the user along with their output, what i want to have is a file having only the commands (i.e. without the result of executing those commands)....

Anyone can help with this????
  #5 (permalink)  
Old 09-17-2006
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,509
then you could turn on accounting instead, and then use the last or lastcomm commands to display commands entered by user. script -a is probably not the correct tool for your requirement
  #6 (permalink)  
Old 09-17-2006
Hitori's Avatar
Hitori Hitori is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2006
Posts: 360
Quote:
Originally Posted by charbel
I understand what you have said but the .sh_history stores all commands entered by all users (i.e. its the shell history and not the user history). What i am looking for here is the user history.
.*_history files are stored in user's home folder for each user not for all
  #7 (permalink)  
Old 09-18-2006
charbel charbel is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 41
I agree with u that the .*_history stores the command for each user in their home directory. But what if i have 2 users having the same home directory, then how to distniguish shish user have enetered which commands (i.e. the .*_history will then be the history file for both users and not only for one of them since both having the same shell and the same home directory).

Any idea about this?
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 11:29 PM.


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