Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This 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.


  Search this Thread
Old 04-28-2009, 09:52 PM   #1
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Rep: Reputation: 58
Does bash shell parameter expansion run the risk of overflowing command line buffer?

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?

Last edited by david1941; 04-28-2009 at 09:56 PM. Reason: premature posting while attempting to insert code tags
Old 04-28-2009, 10:13 PM   #2
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Original Poster
Rep: Reputation: 58
Oops! I mean "command substitution", not "parameter expansion" as I wrote. $(command)




Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to pass command-line parameter to shell script? Kropotkin Linux - Newbie 12 07-25-2011 09:24 AM
LXer: Bash Parameter Expansion LXer Syndicated Linux News 0 10-02-2008 03:40 PM
pam_winbind buffer overflowing? humbletech99 Linux - Networking 0 11-02-2006 04:59 AM
linux bash - how to use a dynamic parameter in shell parameter expansion expression nickleus Linux - General 2 08-21-2006 04:54 AM
bash shell command line expansion hansi umayangan Linux - General 2 03-13-2005 11:31 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration