Bash History Files

2010-11-08 Thread Ajay Jain
Hi,

I use bash via Xterm. As a result I open multiple Xterm windows. When
I type commands on the shell, they get saved only for that particular
shell's history. I want to be able to collate that history, so that if
I type commands on shell 1, I can search the same in the history of
shell 2 in real time. I also want that this history be saved in a
collated manner when I exit the shells.

For example, the shell I and shell 2 should show the following:

Shell1:
bash> ls

Shell2:
bash> history
...
ls (from Shell 1)
history (from Shell 2)

After Relogin, Shell1:
bash> history
ls (from Shell 1)
history (from Shell 2)
history (from Shell 1)

Is there anything I could do?

Regards,
Ajay.



Issue with Getopts

2010-11-14 Thread Ajay Jain
Hi,

I use 'getopts' in my shell script. If I run script normally, it works
fine. However, the moment I run the script in the current shell (ie .
), it fails returning error. Basically it is not able to
parse the arguments. Any reason, why?

Regards,
Ajay.



Clear Screen

2010-12-01 Thread Ajay Jain
Hi,

I use bash on Xterm.
While working you press Ctrl-L, so that the screen gets cleared and
you see the currently line only. But you may want to see the last
outputs/prints. However, if you do a Ctrl-L/clear command, these
prints go away. In that case, what can you use so that you clear the
screen of the prints/outputs from last command. But in case you want
to see the last output, you can just go scroll up/pageup.

I looked the manpage but this info is not available.

Thanks in Advance,
Ajay