Changing History to only store unique commands

Peter Hindrichs pth at ispnet.ca
Wed Sep 30 18:51:14 PDT 2009


On 2009-09-30, at 21:21 , Ryan Schmidt wrote:

>
> On Sep 30, 2009, at 19:43, Peter Hindrichs wrote:
>
>> I have wanted to set up my history to only show a one time  
>> occurrence of each command that I use.
>>
>> I found this on the web:  "http://reviews.cnet.com/8301-13727_7-10361343-263.html?tag=mncol;title 
>> "
>>
>> I followed the procedure and couldn't get the file to save. After  
>> some research I found that I had to create the ".bash_profile"  
>> file, which I did and it
>>
>> worked. However at this point I couldn't access the ports, so I  
>> removed the .bash_profile, closed the terminal and reopened and now  
>> my ports are back
>>
>> with no issues.
>>
>> My question is can I under ports set up the same kind of profile,  
>> so that history will not show any duplications. If this is possible  
>> how would I go about doing this ?
>
> Sounds like the MacPorts installer set up your PATH in  
> your .profile. Bash will read startup instructions from  
> either .bash_profile or .profile, but ignores .profile  
> if .bash_profile is present. So, pick one file and put all your code  
> in that one, and delete the other one.

Freedom:~ peterhin$ ls -a
.
..
.CFUserTextEncoding
.DS_Store
.Trash
.Xauthority
.Xcode
.adobe
.bash_history
.citrix
.cups
.dvdcss
.fontconfig
.lesshst
.macports
.profile
.profile.macports-saved_2009-09-28_at_09:30:38
.profile.save
.viminfo
CTX.DAT
Desktop
Documents
Downloads
Library
LimeWire
Movies
Music
Pictures
Public
Sites
WLink
mbox
–p

So If I understand correctly I should delete the .profile.save and  
place the  "export HISTCONTROL=ignoredups" in the .profile and all  
should work.

>
>

Peter







More information about the macports-users mailing list