Does bash shell parameter expansion run the risk of overflowing command line buffer?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
In a bash shell, does parameter expansion happen on the command line or in within the bash processing?
I have a line in a shell that contains:
chmod -x $(find $BASE_DIR/ -type f |tee $BASE_DIR/FileManifest)
and FileManifest turns out to be 32K in length.
I changed it to be:
find $BASE_DIR/ -type f |tee $BASE_DIR/FileManifest| while read file; do chmod -x $file; done
because I was concerned the parameter expansion may cause buffer overflow.
Was I wrong to be concerned?
Dave
Last edited by david1941; 04-28-2009 at 10:56 PM..
Reason: premature posting while attempting to insert code tags
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.