mainThe GNU Bourne-Again SHell - Support: sr #110883, Process Substitution fails within...

 
 

sr #110883: Process Substitution fails within sourced script within command.bash

Submitter:  james <ripspin>
Submitted:  Fri 26 May 2023 01:25:09 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  4 - Important Status:  Done
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 02 Jun 2023 09:23:51 PM UTC, comment #1: 

Thanks for the report. The fix is to retain the FIFOs or pipe file descriptors across the entire execution of `.' (or, if you prefer, `source').

Chet Ramey <chet>
Group administrator
Fri 26 May 2023 01:25:09 PM UTC, original submission:  

bash -version
GNU bash, version 5.2.0(1)-release (x86_64-pc-linux-gnu)

File: command.bash is:
#!/bin/bash
echo "STRACE_MARKER"
 . /rtmp/source <( echo -e "\ntest line1\ntest line2\ntest line3\ntest line4" )

file: source is:
#!/bin/bash

\ls -l "${1}"
if [ -e "${1}" ]; then
[ -p "${1}" ]&& echo "named pipe (FIFO)" && return
[ -L "${1}" ]&& echo "symbolic link" && return
[ -r "${1}" ]&& echo "readable" && return
echo "NNNO"
return
fi
echo "${1} does not exist"
return

$ strace /rtmp/command.bash  2>/rtmp/strace_output
STRACE_MARKER
lr-x------ 1 root root 64 May 26 23:10 /dev/fd/63 -> pipe:[553110]
NNNO

And attached strace_output file

james <ripspin>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #54786:  command.bash added by ripspin (113B - application/octet-stream)
file #54787:  output_result added by ripspin (107B - application/octet-stream)
file #54788:  source added by ripspin (251B - application/octet-stream)
file #54789:  strace_output added by ripspin (91KiB - application/octet-stream)

 

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)
  • -email is unavailable- added by ripspin (Submitted the item)
  •  

    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.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-06-02 chet StatusNone Done
    2023-05-26 ripspin Attached File- Added command.bash, #54786
        Attached File- Added output_result, #54787
        Attached File- Added source, #54788
        Attached File- Added strace_output, #54789

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code