The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
| with find -exec vijay_0209 Shell Programming and Scripting 3 04-22-2009 06:23 PM
exec JamesByars UNIX for Advanced & Expert Users 5 12-30-2007 03:35 PM
find and exec big123456 UNIX for Advanced & Expert Users 2 01-02-2006 12:10 PM
exec 3 execution snehal UNIX for Advanced & Expert Users 0 11-16-2005 08:11 AM
exec Nisha Shell Programming and Scripting 1 09-23-2002 06:56 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-03-2009
bharadiaam bharadiaam is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 3
Help with use of `` vs exec

Hi all,
I had an issue regarding use of `` or exec in perl . `` are considered to be unsafe. Why? In my case an user would be giving some parameters as input and I will form an command of it and execute it using ``. It is important to capture output as i have to parse the output. As well as I need to know success or failure of command. There are many such commands so use of open() to execute the command wont help.
I am clearing the input parameters if they contain following metacharacters:
$cmd =~ s/&|;|\`|\"|\*|\?|~|\(|\)|\[|\]|\n|\r/-/g;
Is this a good solution. I assume this is what taint mode does.
If I have to use exec and pass command as array as well as capture output, how can I do that?

Thanks,
Akshay
 

Bookmarks

Tags
backticks, exec, metacharacter

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0