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 > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
running commands from outside of bash rakabarp Shell Programming and Scripting 3 03-13-2008 06:40 AM
Problem running plsql & unix commands in 1 script siog UNIX for Dummies Questions & Answers 5 10-05-2006 10:46 AM
Running shell scripts automatically without using Batch or at commands ritzwan0 Shell Programming and Scripting 3 09-17-2006 02:51 PM
Problem in running shell script gammit UNIX for Dummies Questions & Answers 6 09-11-2006 01:42 AM
Machine running out of RAM Esaia Linux 2 03-10-2006 03:34 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-07-2008
abhishek0071 abhishek0071 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 14
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
  #2 (permalink)  
Old 02-07-2008
gus2000 gus2000 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 157
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.
  #3 (permalink)  
Old 02-07-2008
HPAVC's Avatar
HPAVC HPAVC is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 106
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
  #4 (permalink)  
Old 02-08-2008
abhishek0071 abhishek0071 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 14
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.
  #5 (permalink)  
Old 02-11-2008
abhishek0071 abhishek0071 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 14
please suggest me the way if any one know
  #6 (permalink)  
Old 02-15-2008
nhydra nhydra is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 1
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.
  #7 (permalink)  
Old 02-15-2008
sb008 sb008 is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 384
Quote:
Originally Posted by abhishek0071 View Post
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.
What output do you get if you enter the command:

alias

Last edited by sb008; 02-15-2008 at 04:19 PM..
Closed Thread

Bookmarks

Tags
solaris

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:21 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