Problem in running bash shell commands on HP-UX machine

Hello All,

After login to the server we are explicitly calling /usr/local/bin/bash to activate bash shell properly.
But since commands are not executing properly so I think it is not initialized well. I am facing following problems:
1) If I want to have a look on a particular file using tail command say last 20000 lines i.e. tail -20000 file.txt , it is not working it is showing me the default number of lines. On the other hand tail -f file.txt is working fine(Basically for logging info.)
2) On pressing the up arrow key button(get the previous command from bash_history) and display the commands but it is not happening at all. Also if I press down arrow key button and then press up key button it show me the previous command but in vi mode.

Please suggest me the way.

Thanks & Regards
Abhishek

The "tail" command is not a shell builtin, so the shell should have no impact.

If the arrow keys are not working as expected, your $TERM is probably not set correctky.

So your login shell is what exactly and what is being run in this 'new' shell session in terms of a profile?

Not to be stupid but "echo $SHELL" does say bash right (even if the prompt says "user bash2.0 $")? It doesn't jump to ksh or something else (I was on a Solaris machine where someone did that in an /etc/profile) and it was quite hard to detect.

You could have some odd start-up profile stuff (my guess) such as not preserving history or enable-keypad.

Look at your aliases (type alias), you can override the alias with a prefix of "\" for example rather than working to find the full path for everything. There might be multiple tails such as a script or what not, you can find them with 'which tail' (some machines will show aliases in that list as well)

\tail -2000

Thanks for the quick response.
How can I set $TERM properly? Also be specific I am facing 2 problems :
1) I am not able to use tail properly. (Exactly I need last 25000 lines of a line and tail -25000 filename.txt is giving me default number of lines)
2) On pressing up arrow key the last command executed should be displayed which is not happening.

Also which tail is giving me the following output :
/usr/bin/tail

Please suggest me the way I can do these.

please suggest me the way if any one know

I am not sure what are you trying to do but tail -n 25000 file works perfect for me.
Probably you mean something different with tail -25000, but you may try.

What output do you get if you enter the command:

alias