Is there a way to have a command that does not show up in history? Or a way to pipe a string where the string doesn't show up in history?
Ie, I set some passwords with:
echo "some string and stuff" ¦ sha512sum
(Probably with cut and awk and other such things)
And I'd like a way for my system to not store my password scheme. I'd prefer something better than editing my history file.
04-27-2011, 11:25 PM
Kamaraju S Kusumanchi
Command history
shawn wilson wrote:
> Is there a way to have a command that does not show up in history? Or a
> way to pipe a string where the string doesn't show up in history?
>
> Ie, I set some passwords with:
> echo "some string and stuff" ¦ sha512sum
> (Probably with cut and awk and other such things)
>
> And I'd like a way for my system to not store my password scheme. I'd
> prefer something better than editing my history file.
In bash, If I prepend the command with a space character, it does not show
up in the ~/.bash_history file.
hth
raju
--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: ipa8lt$efi$1@dough.gmane.org">http://lists.debian.org/ipa8lt$efi$1@dough.gmane.org
04-28-2011, 06:51 AM
Vangelis Katsikaros
Command history
On 04/28/2011 02:25 AM, Kamaraju S Kusumanchi wrote:
shawn wilson wrote:
Is there a way to have a command that does not show up in history? Or a
way to pipe a string where the string doesn't show up in history?
Ie, I set some passwords with:
echo "some string and stuff" ¦ sha512sum
(Probably with cut and awk and other such things)
And I'd like a way for my system to not store my password scheme. I'd
prefer something better than editing my history file.
In bash, If I prepend the command with a space character, it does not show
up in the ~/.bash_history file.
This happens if in .bashrc you set the shell variable HISTCONTROL to
include the value "ignorespace". See man bash
example:
HISTCONTROL=ignoredups:ignorespace
Vangelis
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Is there a way to have a command that does not show up in history?
> Or a way to pipe a string where the string doesn't show up in
> history?
>
> Ie, I set some passwords with:
> echo "some string and stuff" | sha512sum
> (Probably with cut and awk and other such things)
Apart from beginning the command with a space as already mentioned,
you could enter just the command "sha512sum" then as input type
some string and stuff
followed by Ctrl-D.
--
Cheers,
Clive
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110428071949.GA3425@rimmer.esmertec.com">http://lists.debian.org/20110428071949.GA3425@rimmer.esmertec.com
04-28-2011, 09:07 AM
Arno Schuring
Command history
shawn wilson (ag4ve.us@gmail.com on 2011-04-27 18:58 -0400):
> Is there a way to have a command that does not show up in history? Or
> a way to pipe a string where the string doesn't show up in history?
see the HISTIGNORE variable in the bash manual, and edit ~/.bashrc
accordingly. Most used is something like
export HISTIGNORE=" *"
which will not save any command that starts with a space.
Regards,
Arno
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110428110715.3b6928f8@neminis.loos.site">http://lists.debian.org/20110428110715.3b6928f8@neminis.loos.site
04-28-2011, 12:13 PM
Sophoklis Goumas
Command history
On Thu, Apr 28, 2011 at 01:58, shawn wilson <ag4ve.us@gmail.com> wrote:
> ...
>
> And I'd like a way for my system to not store my password scheme. I'd prefer
> something better than editing my history file.
Instead of tampering with your system what would you say on issuing those
sensitive commands in a new shell and then KILL that shell?
For example:
$ echo "This will propably get into .bash_history."
This will propably get into .bash_history.
$ bash
$ echo "While this won't when this shell gets KILLED!" | sha512sum
...
$ pgrep bash
$ kill <PID-of-that-new-bash-shell>
$
Sophoklis
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: BANLkTi=K43EqXivCk6DZf7QK8wuAZgdYzg@mail.gmail.com ">http://lists.debian.org/BANLkTi=K43EqXivCk6DZf7QK8wuAZgdYzg@mail.gmail.com
04-28-2011, 01:00 PM
Kelly Clowers
Command history
On Wed, Apr 27, 2011 at 23:51, Vangelis Katsikaros <ibob17@yahoo.gr> wrote:
> On 04/28/2011 02:25 AM, Kamaraju S Kusumanchi wrote:
>>
>> shawn wilson wrote:
>>
>>> Is there a way to have a command that does not show up in history? Or a
>>> way to pipe a string where the string doesn't show up in history?
>>>
>>> Ie, I set some passwords with:
>>> echo "some string and stuff" ¦ sha512sum
>>> (Probably with cut and awk and other such things)
>>>
>>> And I'd like a way for my system to not store my password scheme. I'd
>>> prefer something better than editing my history file.
>>
>> In bash, If I prepend the command with a space character, it does not show
>> up in the ~/.bash_history file.
>>
>
> This happens if in .bashrc you set the shell variable HISTCONTROL to include
> the value "ignorespace". See man bash
>
> example:
> HISTCONTROL=ignoredups:ignorespace
>
Or HISTCONTROL=ignoreboth
Cheers,
Kelly Clowers
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: BANLkTik_pMcGkyC81B5Oo_NTh48gz1JmyQ@mail.gmail.com ">http://lists.debian.org/BANLkTik_pMcGkyC81B5Oo_NTh48gz1JmyQ@mail.gmail.com
04-28-2011, 01:00 PM
Kelly Clowers
Command history
On Wed, Apr 27, 2011 at 23:51, Vangelis Katsikaros <ibob17@yahoo.gr> wrote:
> On 04/28/2011 02:25 AM, Kamaraju S Kusumanchi wrote:
>>
>> shawn wilson wrote:
>>
>>> Is there a way to have a command that does not show up in history? Or a
>>> way to pipe a string where the string doesn't show up in history?
>>>
>>> Ie, I set some passwords with:
>>> echo "some string and stuff" ¦ sha512sum
>>> (Probably with cut and awk and other such things)
>>>
>>> And I'd like a way for my system to not store my password scheme. I'd
>>> prefer something better than editing my history file.
>>
>> In bash, If I prepend the command with a space character, it does not show
>> up in the ~/.bash_history file.
>>
>
> This happens if in .bashrc you set the shell variable HISTCONTROL to include
> the value "ignorespace". See man bash
>
> example:
> HISTCONTROL=ignoredups:ignorespace
>
Or HISTCONTROL=ignoreboth
Cheers,
Kelly Clowers
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: BANLkTik_pMcGkyC81B5Oo_NTh48gz1JmyQ@mail.gmail.com ">http://lists.debian.org/BANLkTik_pMcGkyC81B5Oo_NTh48gz1JmyQ@mail.gmail.com
04-28-2011, 04:35 PM
Andrew McGlashan
Command history
Hi Shawn,
shawn wilson wrote:
Is there a way to have a command that does not show up in history? Or a
way to pipe a string where the string doesn't show up in history?
Ie, I set some passwords with:
echo "some string and stuff" ¦ sha512sum
(Probably with cut and awk and other such things)
And I'd like a way for my system to not store my password scheme. I'd
prefer something better than editing my history file.
Something like this will work:
# echo |sha512sum <<EOF
> $(echo fred smith was here|awk '{print $2,$4}')
> EOF
b01bd5351f6490469ea718d4ccc64eea7f0f6fcab25d34136e c24043872b11606c857f0550960be512d262921b466271e563 644bb42688d5ed6477f1292826c6
-
# echo |sha512sum <<EOF
> $(echo fred smith was a hero once upon a time|tr 'aeiout' '@310U7')
> EOF
1bc9a23b486bba1a259ca9162d87c0a8ae415c91e05fedcbb5 e8da47a9fd741418389ebd8e2fad2a1d89f630c003067c7424 dc3389de29399c77e18674548331
-
Testing it works as expected (the sha512sum value that is) ...
# echo smith here|sha512sum
b01bd5351f6490469ea718d4ccc64eea7f0f6fcab25d34136e c24043872b11606c857f0550960be512d262921b466271e563 644bb42688d5ed6477f1292826c6
-
(heh, just realized that my earlier reply didn't go to the list) at any rate,
thank y'all, preceding the command with space does the job just fine.
i'll have to read up on HISTCONTROL and HISTIGNORE. these look pretty
powerful (for my use).
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: BANLkTimndh2JrtVUEaWqPVVf7SAF4w-EKw@mail.gmail.com">http://lists.debian.org/BANLkTimndh2JrtVUEaWqPVVf7SAF4w-EKw@mail.gmail.com