Pass a null terminated string to bash function -


my exported function :

myfunc(){ # operation null terminated string # if use $1, guaranteed null terminated string? } 

for sake of example, consider

find . -type -f -print0 | while read -rd '' line myfunc "$line" done 

if you're using print0 make sure use empty ifs= in addition -d '' in read make null delimiter:

while ifs= read -r -d '' line;    myfunc "$line" done < <(find . -type f -print0) 

as shown can avoid pipeline , use process substitution.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -