Article View: gnu.bash.bug
Article #420bash -c and aliases
From: Ray Moody
Date: Fri, 04 Aug 1989 01:04
Date: Fri, 04 Aug 1989 01:04
81 lines
2571 bytes
2571 bytes
Bash -c and aliases don't mix.
The problem is that the lexer terminates the string given to -c
with \377 (really (char)EOF). The alias expansion code does not
consider \377 to be whitespace. If you say "bash -c foo" when foo is
aliased, bash checks to see if foo\377 is aliased to anything. It
isn't.
Ray
-------------------------------------------------------------------------------
RCS file: RCS/alias.h,v
retrieving revision 1.2
diff -c -r1.2 alias.h
*** /tmp/,RCSt1006612 Thu Aug 3 20:01:57 1989
--- alias.h Thu Aug 3 19:20:37 1989
***************
*** 4,10
#define _ALIAS_
#ifndef whitespace
! #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
#endif
#ifndef savestring
--- 4,10 -----
#define _ALIAS_
#ifndef whitespace
! #define whitespace(c) (((c) == ' ') || ((c) == '\t') || ((c) == (char)EOF))
#endif
#ifndef savestring
===================================================================
RCS file: RCS/general.h,v
retrieving revision 1.2
diff -c -r1.2 general.h
*** /tmp/,RCSt1006612 Thu Aug 3 20:01:57 1989
--- general.h Thu Aug 3 19:20:39 1989
***************
*** 12,18
#endif
#ifndef whitespace
! #define whitespace(c) (((c) == ' ') || ((c) == '\t'))
#endif
#ifndef digit
--- 12,18 -----
#endif
#ifndef whitespace
! #define whitespace(c) (((c) == ' ') || ((c) == '\t') || ((c) == (char)EOF))
#endif
#ifndef digit
===================================================================
RCS file: RCS/alias.c,v
retrieving revision 1.2
diff -c -r1.2 alias.c
*** /tmp/,RCSt1006612 Thu Aug 3 20:01:58 1989
--- alias.c Thu Aug 3 19:52:31 1989
***************
*** 19,24
with Bash; see the file LICENSE. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include "general.h"
#include "alias.h"
--- 19,25 -----
with Bash; see the file LICENSE. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+ #include <stdio.h>
#include "config.h"
#include "general.h"
#include "alias.h"
Technical Details
Message-ID:
<8908040104.AA06629@gibbs.physics.purdue.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!GIBBS.PHYSICS.PURDUE.EDU!rayShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!GIBBS.PHYSICS.PURDUE.EDU!ray From: ray@GIBBS.PHYSICS.PURDUE.EDU (Ray Moody) Newsgroups: gnu.bash.bug Subject: bash -c and aliases Message-ID: <8908040104.AA06629@gibbs.physics.purdue.edu> Date: 4 Aug 89 01:04:22 GMT Sender: sgupta@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 81