LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

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

Rep: Reputation: 57
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?
Dave

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
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS6
Posts: 267

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

Dave
 
  


Reply

Tags
code


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


All times are GMT -5. The time now is 10:55 PM.

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