pash icon indicating copy to clipboard operation
pash copied to clipboard

r_split needs exported functions

Open dkarnikis opened this issue 3 years ago • 1 comments

As @tammam1998 informed me, there is a bug when using --r_split flag in pash and calling functions. Reproduce:

extract_text()
{
    :
}

extract_tex()
{
    :
}

test1()
{
    :
}

# this fails
echo 'test' |
extract_text
# this doesn't fail
echo 'test' |
extract_tex
# this doesn't fail
extract_text 
# this doesn't fail
echo 'test1' |
test1

Adding export -f extract_text seems to solve the issue. However, I do not understand why the other function calls seem to pass. Tested on deathstar and my local machine.

dkarnikis avatar Nov 24 '21 09:11 dkarnikis

This is an issue with how r_split works, and it is low priority since exporting the functions does the trick.

angelhof avatar Nov 24 '21 14:11 angelhof

This is not really a bug, so closing with wontfix.

angelhof avatar Feb 20 '23 22:02 angelhof