You are not logged in.

#1 2008-02-17 09:10:25

swedala
Member
Registered: 2008-02-17
Posts: 8

bash issue

Trying to use command:

echo -e "\142"

On my slackware i get this result.
swedala@alfa:~ > echo -e "\142"
b
swedala@alfa:~ >


On my archlinux i get this output:
[swedala@baldur ~]$ echo -e "\142"
\142
[swedala@baldur ~]$

Both workstations are bash shell default, but I can not understand why I not get the same result.

Any idea?

Offline

#2 2008-02-17 09:34:29

neotuli
Lazy Developer
From: London, UK
Registered: 2004-07-06
Posts: 1,204
Website

Re: bash issue

Arch is using bash's builtin "echo", while your other distro is using the "echo" binary.

[simo@redshift ~]$ echo -e "\142"
\142
[simo@redshift ~]$ man bash
[simo@redshift ~]$ /bin/echo -e "\142"
b
[simo@redshift ~]$

It's possible that your other distro has aliased "bash" to "/bin/bash" in /etc/profile or your bashrc.


The suggestion box only accepts patches.

Offline

#3 2008-02-17 09:45:54

swedala
Member
Registered: 2008-02-17
Posts: 8

Re: bash issue

Thanks for quick response.

I will check what's aliased on my other dist.

Offline

#4 2008-02-17 14:15:34

pixellany
Member
From: Annapolis, MD
Registered: 2006-05-12
Posts: 59

Re: bash issue

PCLinuxOS:
[mherring@localhost ~]$ echo -e "\142"
b
[mherring@localhost ~]$ /bin/echo -e "\142"
b

No aliases in place for echo


"It's always something." --Gilda Radner, 1946 - 1989

Offline

#5 2008-02-17 14:45:58

eerok
Member
From: Canada
Registered: 2005-03-20
Posts: 171

Re: bash issue

$ echo -e "\142"
\142
$ /bin/echo -e "\142"
b
$ which echo
/bin/echo

Weird.


noobus in perpetuus

Offline

#6 2008-02-17 16:10:34

dmartins
Member
Registered: 2006-09-23
Posts: 360

Re: bash issue

Try:
echo -e "\0142"
Maybe it is more portable! Just a guess.

Offline

Board footer

Powered by FluxBB