LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux > 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

Tags used in this thread
Popular LQ Tags

Reply
 
Thread Tools
Old 04-28-2009, 10:52 PM   #1
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: Fedora [7,9]
Posts: 186
Thanked: 23
Does bash shell parameter expansion run the risk of overflowing command line buffer?


[Log in to get rid of this advertisement]
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
david1941 is offline  
Tag This Post
Reply With Quote
Old 04-28-2009, 11:13 PM   #2
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: Fedora [7,9]
Posts: 186
Thanked: 23

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

Dave
david1941 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 4 11-17-2009 06:08 PM
LXer: Bash Parameter Expansion LXer Syndicated Linux News 0 10-02-2008 04:40 PM
pam_winbind buffer overflowing? humbletech99 Linux - Networking 0 11-02-2006 05:59 AM
linux bash - how to use a dynamic parameter in shell parameter expansion expression nickleus Linux - General 2 08-21-2006 05:54 AM
bash shell command line expansion hansi umayangan Linux - General 2 03-13-2005 12:31 PM


All times are GMT -5. The time now is 04:54 AM.

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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration