Optimized 'show --buildfile' command

Optimized the 'show --buildfile' command to avoid the use of temporary
files in /tmp and reduce the number of calls to external programs.