helpThe GNU Bourne-Again SHell - Support: sr #110342, Invalid alias expansion

 
 

sr #110342: Invalid alias expansion

Submitter:  None
Submitted:  Wed 28 Oct 2020 11:49:32 PM UTC
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Invalid
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Mon 09 Nov 2020 02:07:29 PM UTC, comment #1: 

This is how alias expansion is defined to behave.

"If  the last  character  of  the  alias value is a blank, then
 the next command word following the alias is also checked for
 alias expansion."

Chet Ramey <chet>
Project Administrator
Wed 28 Oct 2020 11:49:32 PM UTC, original submission:  

Aliases are expanded in parameters position and it depends on space in alias definition:

$ echo $BASH_VERSION
5.0.18(2)-release
$ unalias ls
$ alias t=/bin/true
$ ls t
ls: cannot access 't': No such file or directory
$ alias ls=ls
$ ls t
ls: cannot access 't': No such file or directory
$ alias ls='ls '
$ ls t
/bin/true
$ alias ls='ls -l'
$ ls t
ls: cannot access 't': No such file or directory
$ alias ls='ls -l '
$ ls t
-rwxr-xr-x 1 root root 31128 Mar  6  2020 /bin/true

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-11-09 chet StatusNone Invalid

    Back to the top


    Powered by Savane 3.9