LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-04-2011, 07:29 PM   #31
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910

Apart from the funky
Code:
if [ -f  ~/.bashsrc ]; then
        ~/.bahsrc
fi
at the very top I can't see anything wrong with it.

Can you please add
Code:
set +x
to the very TOP of ~/.bashrc temporarily, and try to
source it again?
Code:
. ~/.bashrc
and post the output?


Cheers,
Tink
 
Old 04-04-2011, 08:03 PM   #32
mansour
Member
 
Registered: Nov 2010
Location: Toronto, Canada
Distribution: Ubuntu 10.04 Lucid Lynx - Ubuntu 10.10 notebook - Debian 5.08 - Win XP
Posts: 172

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by Tinkster View Post
Apart from the funky
Code:
if [ -f  ~/.bashsrc ]; then
        ~/.bahsrc
fi
at the very top I can't see anything wrong with it.

Can you please add
Code:
set +x
to the very TOP of ~/.bashrc temporarily, and try to
source it again?
Code:
. ~/.bashrc
and post the output?


Cheers,
Tink


Sorry Actually this was my mistake. The actual file doesn't have this:

Code:
if [ -f  ~/.bashsrc ]; then
        ~/.bahsrc
fi
OK I added set +x to the very TOP of ~/.bashrc,

and this is the result.

mansour@ubuntu-notebook:~$ . ~/.bashrc
mansour@ubuntu-notebook:~$ env | grep -i hist
PROMPT_COMMAND=history -a
mansour@ubuntu-notebook:~$



mansour
 
Old 04-04-2011, 08:21 PM   #33
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by mansour View Post
Sorry Actually this was my mistake. The actual file doesn't have this:

Code:
if [ -f  ~/.bashsrc ]; then
        ~/.bahsrc
fi
OK I added set +x to the very TOP of ~/.bashrc,

and this is the result.

mansour@ubuntu-notebook:~$ . ~/.bashrc
mansour@ubuntu-notebook:~$ env | grep -i hist
PROMPT_COMMAND=history -a
mansour@ubuntu-notebook:~$



mansour
Most puzzling - please try:
Code:
env | grep SHELL
and
Code:
bash ~/.bashrc

Cheers,
Tink
 
Old 04-04-2011, 09:38 PM   #34
mansour
Member
 
Registered: Nov 2010
Location: Toronto, Canada
Distribution: Ubuntu 10.04 Lucid Lynx - Ubuntu 10.10 notebook - Debian 5.08 - Win XP
Posts: 172

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by Tinkster View Post
Most puzzling - please try:
Code:
env | grep SHELL
and
Code:
bash ~/.bashrc

Cheers,
Tink



mansour@ubuntu-notebook:~$ env | grep SHELL
SHELL=/bin/bash
mansour@ubuntu-notebook:~$ bash ~/.bashrc
/home/mansour/.bashrc: line 9: return: can only `return' from a function or sourced script
mansour@ubuntu-notebook:~$


mansour
 
Old 04-05-2011, 05:45 PM   #35
2ck
Member
 
Registered: Mar 2010
Location: /home/twock
Distribution: Debian
Posts: 73
Blog Entries: 9

Rep: Reputation: 21
Quote:
Originally Posted by mansour View Post
How would I "Set the HISTFILE environment variable to ~/.bash_history"?
Please be more specific. what is the command to do that?


mansour
From the bash manpage:
Quote:
HISTFILE
The name of the file in which command history is saved (see HISTORY below). The default value is ~/.bash_history. If unset, the command history is not saved when an interactive shell exits.
In your .bashrc try:
Code:
export HISTFILE=~/.bash_history
Possibly, you don't have the variable set at all. And read the bash manpage--under the heading "History" at least.

note: env doesn't reflect all variables defined within your current shell (that's not what it's for anyway).
 
Old 04-05-2011, 06:59 PM   #36
mansour
Member
 
Registered: Nov 2010
Location: Toronto, Canada
Distribution: Ubuntu 10.04 Lucid Lynx - Ubuntu 10.10 notebook - Debian 5.08 - Win XP
Posts: 172

Original Poster
Rep: Reputation: 2
Exclamation

Quote:
Originally Posted by 2ck View Post
From the bash manpage:


In your .bashrc try:
Code:
export HISTFILE=~/.bash_history
Possibly, you don't have the variable set at all. And read the bash manpage--under the heading "History" at least.

note: env doesn't reflect all variables defined within your current shell (that's not what it's for anyway).


Hello 2ck:


In your .bashrc try:
Code:
export HISTFILE=~/.bash_history
OK, I added export HISTFILE=~/.bash_history
to the end of my .bashrc file.

No changes has yet been achieved.

mansour

Last edited by mansour; 04-05-2011 at 07:47 PM.
 
Old 04-06-2011, 04:21 PM   #37
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Have you ever tried logging in on a console? Bypassing the
gui all together? I'm totally at loss as to what might be
going on in your install ...


Cheers,
Tink

Last edited by Tinkster; 04-06-2011 at 04:23 PM.
 
Old 04-06-2011, 04:38 PM   #38
mansour
Member
 
Registered: Nov 2010
Location: Toronto, Canada
Distribution: Ubuntu 10.04 Lucid Lynx - Ubuntu 10.10 notebook - Debian 5.08 - Win XP
Posts: 172

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by Tinkster View Post
Have you ever tried logging in on a console? Bypassing the
gui all together? I'm totally at loss as to what might be
going on in your install ...


Cheers,
Tink

I actually have installed LTS 10.04 Server on a desktop machine in my home. That's totally a command line install, no GUI there. and I have several services on it, like DHCP, DNS, Apache, SSH,...
But This is a notebook computer and Linux 10.10 ubuntu notebook edition, and is therefore a GUI. I am taking Ubuntu 10.04 Desktop in my school a spart of an IT support course, and this little notebook is a tool to learn that course, as part of my school credit study. My teacher has accepted me to use a 10.10 notebook, instead of a VirtualBox installation of Ubuntu desktop 10.04 lucid.

Sorry, but did I tell you that I have several partitions on this machine, and various file systems, and would that matter to our dicussion of history feature not working?
This is how I configured various partitions on my machine. This was our Lab 1 assignment in this course.
Code:
/boot         100 MB        Ext2

/root)        8 GB          Ext3

/var          4 GB          Ext2

/srv          4 GB          Ext3

/usr          4 GB          Ext2

/tmp          5 GB          Ext2

Swap space    6 GB          N/A

/home         Remaining space    Ext3

mansour

Last edited by mansour; 04-07-2011 at 11:27 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lupu511 pupsave feature apparently is shutting down my notebook to often Benny7440 Linux - Newbie 2 10-16-2010 01:10 PM
Working at the command line with Ubuntu Server edition. David_R Linux - Server 1 06-30-2010 07:02 AM
LXer: A Brief History of Brown: Ubuntu Feature Timeline LXer Syndicated Linux News 0 03-18-2010 12:00 AM
Implement a Unix Shell with History Feature vipin_jss Linux - Newbie 2 05-07-2009 07:38 PM
soundblaster live 24bit edition not working in ubuntu wormraper Ubuntu 2 08-10-2005 06:01 PM


All times are GMT -5. The time now is 02:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration