Error running the history command


 
Thread Tools Search this Thread
Operating Systems AIX Error running the history command
# 1  
Old 01-05-2011
Network Error running the history command

When I try to run the history command from the prompt i get the following error:

$ history
ksh: cd: 0403-011 The specified substitution is not valid for this command.

ON running history with a parameter I get the following
$ history -10
ksh: cd: 0403-008 The number of parameters specified is not correct.

I have not defined history in my .profile
also runnning which command returns following:
$ which history
which: 0652-141 There is no history /usr/bin /usr/local/bin etc..
that means the history command is not found..

Other users are able to run the same command . I just don't understand where is my shell picking the history command from?

It shows "ksh: cd:" which means cd command is getting executed...

Please help ...Smilie

Last edited by meetzap; 01-05-2011 at 05:03 AM.. Reason: None..
# 2  
Old 01-05-2011
You can have a try as follow if you want:
# find / -name history
And then add the path in your profile.
Good luck!

---------- Post updated at 08:38 AM ---------- Previous update was at 08:37 AM ----------

Still you can build a link to the path that already in your profile.
# 3  
Old 01-05-2011
Thanks for reply allanwang77, but i think you have not followed my problem. The history command is working for other users on the same machine and giving problems to me..

$ history
ksh: cd: 0403-011 The specified substitution is not valid for this command.

which clearly shows its picking the script from somewhere where there is a 'cd' command involved....

even running 'which' command doesn't show this history script anywhere in the path..
# 4  
Old 01-05-2011
My server can run history as well, but the check working same with you:
-bash-3.00$ man history
Manual entry for history not found or not installed.
-bash-3.00$ which history
which: 0652-141 There is no history in /usr/linux/bin /usr/bin /etc /usr/sbin /usr/ucb /usr/bin/X11 /sbin /usr/java14/jre/bin /usr/java14/bin /usr/python/bin.
-bash-3.00$ whereis history
history:
The only different is I used bash.

---------- Post updated at 09:06 AM ---------- Previous update was at 09:04 AM ----------

Do you think that is the problem?

And if you login server used the same userid as others'?
# 5  
Old 01-05-2011
history usually is a shell-builtin.
What is the output of
Code:
type history

# 6  
Old 01-05-2011
history is usually an alias for "fc -l".
As advised above, what is the output from
Code:
type history

Also, what Shell are you running?
Code:
echo $SHELL

(I realise that your prompt says bash)
# 7  
Old 01-06-2011
Problem Solved :)

Thank you all so very much.
I had an alias set for fc='cd /home/user/src/bin' in my .profile
Guess thats the reason why history didn't work for me as clearly pointed by cero and methyl, its an alias for 'fc -l'.
I renamed the alias fc as fc1 and everything started working for me again..

Thanks as ton to cero,methyl and allanwang77 ..Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

I'm facing problem with rpm command, when running the command and appears this error:

exec(): 0509-036 Cannot load program /usr/opt/freeware/bin/rpm because of the following errors: 0509-022 Cannot load module /opt/freeware/lib/libintl.a(libintl.so.1). 0509-150 Dependent module /opt/freeware/lib/libiconv.a(shr4.o) could not be loaded. 0509-152 Member... (4 Replies)
Discussion started by: Ohmkar
4 Replies

2. Red Hat

FATAL: Error running install command for binfmt_0000

Hi, Firstly, I want to say hello to all of you guys. My first post here... I have issue with CentOS and I hope that there is someone who can help or even explain what could cause this kind of situation. I have installed CentOS 5.7 x86_64 into Hyper-V (Windows Server 2012 R2) environment. After... (0 Replies)
Discussion started by: gigolos
0 Replies

3. UNIX for Advanced & Expert Users

Library file error while running command

I am running a command in Solaris non-global zone and it is complaining for a library file, while that is already preset in server. mwcontrol: fatal: relocation error: file /usr/openwin/lib/locale/common/xlibi18n.so.2: symbol _XlcAddUtf8Converters: referenced symbol not found # ls -l... (15 Replies)
Discussion started by: solaris_1977
15 Replies

4. Shell Programming and Scripting

Getting syntax error while running awk command

Hello Gurus, I am firing the below command : df -g | grep -v var| awk '{ (if $4 > 90% ) print "Filesystem", $NF,"over sized";}' But I am getting the below error:- ====== syntax error The source line is 1. The error context is {if ($4 > >>> 90%) <<< awk: The... (9 Replies)
Discussion started by: pokhraj_d
9 Replies

5. UNIX for Dummies Questions & Answers

search history without result running automatically

Hi I want to search the history of commands. for the last use of eg.$ service httpd reload $history = brings up the full list $!serv = runs service httpd reload, if thast was the last command used with the string $!?serv? = does the same as above I do not want to run the command... (1 Reply)
Discussion started by: dunsta
1 Replies

6. UNIX for Dummies Questions & Answers

The history command: See other users command history

Can anyone tell this: If two users are logged into the same server from different locations. Is there a way to see the history command of the other user? I tried the history command, but it is showing me only the commands I used. Thanks in advance for your help. Iamnew2solaris (1 Reply)
Discussion started by: iamnew2solaris
1 Replies

7. UNIX for Dummies Questions & Answers

error while running nm command

I am running nm for a file. the command is nm -f libC.a but it gives below error nm: libC.a: 0654-203 Specify an XCOFF object module. any solution ? Please use and tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks. (2 Replies)
Discussion started by: yatrik007
2 Replies

8. Shell Programming and Scripting

stop users from running 'history -c' in Linux

Hi All, My question is how can i stop my users on system from deleting their history. How can i stop the users from running 'history -c'. I have searched thoroughly on the forum but didn't find any satisfactory solution to the problem. kindly help if you any suggestions Thanx in... (3 Replies)
Discussion started by: xander
3 Replies

9. Shell Programming and Scripting

Cron job giving error while running SSH command

Hi All, The script which i am using to SSH to remote server is working fine when i run is using ./ but when cron runs it it gives error that "ssh: not found" please help!!! (3 Replies)
Discussion started by: visingha
3 Replies

10. UNIX for Advanced & Expert Users

Error when running the make command

Hi, Not really sure whether this question should go to this forum but am giving it a shot. I have compiled a simple C program test.c. #include <stdio.h> #include <stdlib.h> #include <string.h> static int a; int test() { a=a+1; return a; } When I run a make command, I get this: ... (2 Replies)
Discussion started by: nattynatty
2 Replies
Login or Register to Ask a Question