Problem in running bash shell commands on HP-UX machine


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Problem in running bash shell commands on HP-UX machine
# 1  
Old 02-07-2008
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  
Old 02-07-2008
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  
Old 02-07-2008
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  
Old 02-08-2008
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  
Old 02-11-2008
please suggest me the way if any one know
# 6  
Old 02-15-2008
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  
Old 02-15-2008
Quote:
Originally Posted by abhishek0071
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..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem running plsql using printf command on bash shell

I am running plsql using printf on a shell, but i am getting some strange error, can someone point what exactly am i missing, $ echo $SHELL /bin/bash $ printf " > SET serveroutput ON trimspool on feed off echo off > declare > p_val number; > d_val varchar2(10); > begin > SELECT... (1 Reply)
Discussion started by: kamauv234
1 Replies

2. Shell Programming and Scripting

Problem running db2 commands in awk

Hi , I am trying to use the below in awk but failed, any one assist please, awk '{ print $0; if ( $0 ~ /LOADTMP1/ ) { print $4; Table_name=system($( db2 -x "SELECT TRIM(TD.BSCHEMA) || '.' || TRIM(TD.BNAME) AS TABLE_NAME FROM SYSCAT.TABDEP TD WHERE TD.BTYPE='T' AND... (2 Replies)
Discussion started by: Nandy
2 Replies

3. OS X (Apple)

Quit a shell script thats running on a remote machine

I'm in a situation where I am executing a shell script(Bash) on another machine remotely using ssh, and for various reasons sometimes need to quit it and restart it. The shell script being run does many different things, so its hard to know what process to kill on the remote machine, and even if I... (2 Replies)
Discussion started by: TheDrizzle
2 Replies

4. Shell Programming and Scripting

Running BASH commands from a variable

I am trying to assign a command to a variable and use it. I have tried every possible quoting variation except the correct one. :confused: Here is an example: CMD="grep description $i | grep "::"" $CMD | nawk ...Thanks in advance for you help. (1 Reply)
Discussion started by: aschera
1 Replies

5. Shell Programming and Scripting

Shell scripting problems - Commands not on local machine

Hello all- I have done a lot of searching tonight, but all leads seem to be dead ends. Forgive me if this has been covered, but I've searched the forum and the internet. I am having trouble building a shell script which uses SSH to login to our schools 1024 cluster grid. The issue that I am... (1 Reply)
Discussion started by: Sagan
1 Replies

6. Shell Programming and Scripting

Run Shell Commands via HTML on a client machine

Hi guys, so, I have a server running an sqlite database which is accessed by many client machines working as hardware testers, whenever something fails and needs to be replaced the operator would have to enter the Serial Number of the part being replaced as well as some other data. and... (0 Replies)
Discussion started by: sx3v1l_1n51de
0 Replies

7. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

8. Shell Programming and Scripting

Long running shell scripts shuts donw the machine!

Hi, I am very new to shell scripting. I have a script called "RunDMol3.sh" which takes a directory name as input parameter, process somthing using files in the folder and writes output files in the same folder. This is a very heavy job and takes about 1.5 hrs. When I run in manually the script... (2 Replies)
Discussion started by: ramesh.jitkar
2 Replies

9. Programming

Running shell commands from C/C++

Hi guys, I know using system() we can run unix commands but the problem is, I can't get any returns with the system(). I am returning stuff from my shell scripts that I need to be able to read from my C code. Anybody has cure to this problem? :)) Thanks (2 Replies)
Discussion started by: alirezan
2 Replies

10. Shell Programming and Scripting

running commands from outside of bash

Hello all! I have two consoles.I know the PID of these two.Now I want to execute a command in console#1 but from console#2. How can I achieve this? Anyone can do something for my query? Click here if you can't understand my query or to know the need for this query. (3 Replies)
Discussion started by: rakabarp
3 Replies
Login or Register to Ask a Question