Ticket #38575

Unexpected alias substitution of "do"

Open Date: 2018-09-08 22:50 Last Update: 2018-12-29 12:59

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
None
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

Yash rejects the following script as syntax error:

  1. alias fori='for i ' do=';'
  2. set 1
  3. fori do echo $i; done

However, this script should print "1" without error. Alias substitution should not be applied to "do" because it is a reserved word.

Ticket History (3/5 Histories)

2018-09-08 22:50 Updated by: magicant
  • New Ticket "Unexpected alias substitution of "do"" created
2018-09-09 21:37 Updated by: magicant
Comment

Another alias-related bug. In the POSIXly correct mode, an unquoted "esac" cannot be the first pattern in a case list even if it is preceded by "(". The following script should be rejected:

  1. alias CASE='case esac in ( ' ESAC='esac'
  2. CASE ESAC ) echo esac; esac
2018-09-30 02:16 Updated by: magicant
Comment

magicant への返信

  1. alias CASE='case esac in ( ' ESAC='esac'
  2. CASE ESAC ) echo esac; esac

This has been fixed since r3873

2018-09-30 02:22 Updated by: magicant
  • Resolution Update from None to Fixed
  • Status Update from Open to Closed
Comment

magicant への返信

  1. alias fori='for i ' do=';'
  2. set 1
  3. fori do echo $i; done

Fixed in r3898

2018-12-29 12:59 Updated by: magicant
Comment

A test case for the "case" command bug was added in r3901 .

Attachment File List

No attachments

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login