I got error "Argument list too long" when I pass a very long text as an argument to a script. For example:
./myScript.bash "${v_very_long_text}"
Is that a way to fix the error? thanks
I got error "Argument list too long" when I pass a very long text as an argument to a script. For example:
./myScript.bash "${v_very_long_text}"
Is that a way to fix the error? thanks
Method 1:
echo "${v_very_long_text}" > text_file.txt
./myScript.bash $(cat text_file.txt)
Method 2:
tee text_file.txt <<EOF
line 1
line 2
line 3
EOF
./myScript.bash $(cat text_file.txt)