![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| joining command results, and substitution | ncatdesigner | Shell Programming and Scripting | 6 | 04-17-2008 12:37 PM |
| Formatting Substitution Command Not Working in vi | ERPKEN | UNIX for Advanced & Expert Users | 11 | 05-06-2007 10:36 PM |
| complex command substitution | spopuri | Shell Programming and Scripting | 5 | 05-24-2006 09:37 AM |
| command substitution problems with csh using grep | voodoo31 | Shell Programming and Scripting | 2 | 01-14-2006 07:39 AM |
| Preserving space during command substitution | Sabari Nath S | UNIX for Dummies Questions & Answers | 1 | 10-04-2005 10:16 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Substitution of last command
"Is there any substituation of last command or script syntax which can be used as a user. As far I know the "last" command is being used to display information about previous logins. A member of adm group or the user adm can execute it only.
Thanks in advance for your usual help. Ghazi |
|
|||||
|
I'm not too sure I follow - if you want to rerun the last command each shell has a different syntax to allow this - the last command shows a history of logins, not commands. Some OS's provide the lastcomm command if accounting is enabled, although this may require superuser privileges.
You can look into fc -e -, I always alias this (if not pre-aliased) to r in Bourne-type shells thusly: alias r='fc -e -' Then you can do stuff like $ r ls ls -la /my/dir which will execute the last command in your history (providing your shell supports history) starting with "ls". As I say, each shell supports differing history syntax and functionality, please post the output of echo $0 echo $SHELL uname -a plus a further rundown of your exact requirements for a more detailed solution. EDIT: Looking back at your OP, do you want to run last as a user that doesn't have the privilege to run the command? If so sudo may be the solution. Cheers ZB Last edited by zazzybob; 01-16-2005 at 05:35 PM.. |
|
||||
|
I apprecate your quick response.
I am hp and using tcsh. I am not looking for whodo command output (output from the who, ps and acctcom) rather I am ONLY interested to find out when particular user was last time logged on to the system. Is there any way I can find out this if logged in as a develper (not root). Thanks, Ghazi |
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|