View Issue Details

IDProjectCategoryView StatusLast Update
0000943OpenFOAMBugpublic2013-08-05 15:18
Reporteruser526Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSFedoraOS Version16
Summary0000943: foamCleanPath script shows error if $PATH contains the character '@'
Descriptione.g.:
$ mkdir foo@bar
$ OpenFOAM-2.2.1/bin/foamCleanPath foo@bar
sed: -e expression #1, char 13: unknown option to `s'
foo@bar
$

This is because the @ is used as the pattern delimiter in the foamCleanPath, and the @ in the directory name breaks the pattern compilation.
Additional InformationMy version of sed (GNU sed version 4.2.1) allows the use of ":" as the pattern deliminator. As the PATH variable separates its entries with the : character, this is safe to use in the sed as shown in the following patch:

diff --git a/bin/foamCleanPath b/bin/foamCleanPath
index 0498f0c..cad3f0d 100755
--- a/bin/foamCleanPath
+++ b/bin/foamCleanPath
@@ -126,7 +126,7 @@ do
     if [ -e "$dir" ]
     then
         #- no duplicate dirs
- duplicate=$(echo " $dirList " | sed -ne "s@ $dir @DUP@p")
+ duplicate=$(echo " $dirList " | sed -ne "s: $dir :DUP:p")
 
         if [ ! "$duplicate" ]
         then

$ OpenFOAM-2.2.1/bin/foamCleanPath foo@bar
foo@bar
$
TagsNo tags attached.

Activities

henry

2013-08-05 15:18

manager   ~0002368

Resolved by commit fe8e19a381623a8fc8c18b695ead1923f020e569

Issue History

Date Modified Username Field Change
2013-08-05 14:28 user526 New Issue
2013-08-05 15:18 henry Note Added: 0002368
2013-08-05 15:18 henry Status new => resolved
2013-08-05 15:18 henry Resolution open => fixed
2013-08-05 15:18 henry Assigned To => henry