Austin Group Defect Tracker

Aardvark Mark III

Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001258 [1003.1(2016)/Issue7+TC2] Shell and Utilities Objection Error 2019-06-14 10:56 2019-06-14 10:56
Reporter stephane View Status public  
Assigned To
Priority normal Resolution Open  
Status New  
Name Stephane Chazelas
User Reference
Section export utility
Page Number 2402 (in 2018 edition)
Line Number 76898 (in 2018 edition)
Interp Status ---
Final Accepted Text
Summary 0001258: incorrect usage of "." utility in "export" example.
Description The "EXAMPLES" section of the "export" utility has:

export −p > temp-file
unset a lot of variables
... processing
. temp-file

In POSIX compliant shells, "." looks up files in $PATH, not the current directory when the file argument doesn't contain any slash, so it should be: ". ./temp-file".

It may also be worth mentioning that it may not work if the "unset a lot of variables" part unsets LC_CTYPE, LANG or LC_ALL variables (or the "processing" part sets any of them) as the "." utility could then be run in an environment where the charset is different from that used to generate the "export -p" output (in practice it is a problem and a source of security vulnerabilities).

And that it would not "restore an exported variable" that was previously unset but exported if the "processing" part sets those variables. Same if "processing" sets the readonly attribute on any of the variables.
Desired Action Change line 76898 from

   . temp-file


   . ./temp-file

Also, address the other objections in the description if deemed necessary.
Tags No tags attached.
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-06-14 10:56 stephane New Issue
2019-06-14 10:56 stephane Name => Stephane Chazelas
2019-06-14 10:56 stephane Section => export utility
2019-06-14 10:56 stephane Page Number => 2402 (in 2018 edition)
2019-06-14 10:56 stephane Line Number => 76898 (in 2018 edition)

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker