STYLE: avoid old-style shell backticks in various places

This commit is contained in:
Mark Olesen
2017-02-20 09:30:58 +01:00
committed by mark
parent 957635200a
commit d3911dd167
19 changed files with 117 additions and 130 deletions

View File

@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -136,7 +136,7 @@ export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
. $WM_PROJECT_DIR/etc/config.sh/functions
# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile prefs.sh)
# Evaluate command-line parameters and record settings for later
# these can be used to set/unset values, or specify alternative pref files
@ -148,14 +148,14 @@ _foamEval $@
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
#- Clean PATH
cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"
cleaned=$($foamClean "$PATH" "$foamOldDirs") && PATH="$cleaned"
#- Clean LD_LIBRARY_PATH
cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` \
cleaned=$($foamClean "$LD_LIBRARY_PATH" "$foamOldDirs") \
&& LD_LIBRARY_PATH="$cleaned"
#- Clean MANPATH
cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"
cleaned=$($foamClean "$MANPATH" "$foamOldDirs") && MANPATH="$cleaned"
export PATH LD_LIBRARY_PATH MANPATH
@ -168,35 +168,35 @@ _foamSource $WM_PROJECT_DIR/etc/config.sh/aliases
# Source user setup files for optional packages
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/vtk`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ensight`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools`
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/vtk)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ensight)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools)
##_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW`
##_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch)
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW)
# Clean environment paths again. Only remove duplicates
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#- Clean PATH
cleaned=`$foamClean "$PATH"` && PATH="$cleaned"
cleaned=$($foamClean "$PATH") && PATH="$cleaned"
#- Clean LD_LIBRARY_PATH
cleaned=`$foamClean "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleaned"
cleaned=$($foamClean "$LD_LIBRARY_PATH") && LD_LIBRARY_PATH="$cleaned"
#- Clean MANPATH (trailing ':' to find system pages)
cleaned=`$foamClean "$MANPATH"`: && MANPATH="$cleaned"
cleaned=$($foamClean "$MANPATH") && MANPATH="${cleaned}:"
export PATH LD_LIBRARY_PATH MANPATH
#- Clean LD_PRELOAD
if [ -n "$LD_PRELOAD" ]
then
cleaned=`$foamClean "$LD_PRELOAD"` && LD_PRELOAD="$cleaned"
cleaned=$($foamClean "$LD_PRELOAD") && LD_PRELOAD="$cleaned"
export LD_PRELOAD
fi

View File

@ -38,9 +38,7 @@ endif
if ( -r $CEI_HOME ) then
# Special treatment for 32bit OpenFOAM and 64bit Ensight
if ($WM_ARCH == linux && `uname -m` == x86_64) then
setenv CEI_ARCH linux_2.6_32
endif
if ($WM_ARCH-`uname -m` == linux-x86_64) setenv CEI_ARCH linux_2.6_32
# Add to path
setenv PATH ${CEI_HOME}/bin:${PATH}

View File

@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -75,7 +75,7 @@ case Linux:
breaksw
default:
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32|64"
breaksw
endsw
@ -124,11 +124,13 @@ case SunOS:
setenv WM_LDFLAGS '-mabi=64 -G0'
breaksw
default:
echo
echo "Your '$WM_ARCH' operating system is not supported by this release"
echo "of OpenFOAM. For further assistance, please contact www.OpenFOAM.com"
echo
default: # An unsupported operating system
/bin/cat <<USAGE
Your "$WM_ARCH" operating system is unsupported by this OpenFOAM release.
For further assistance, please contact www.OpenFOAM.com
USAGE
breaksw
endsw
@ -230,7 +232,7 @@ case ThirdParty:
# Check that the compiler directory can be found
if ( ! -d "$gccDir" ) then
cat << GCC_NOT_FOUND
/bin/cat << GCC_NOT_FOUND
===============================================================================
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
Cannot find '$WM_COMPILER' compiler installation
@ -272,7 +274,7 @@ GCC_NOT_FOUND
# Check that the compiler directory can be found
if ( ! -d "$clangDir" ) then
cat << CLANG_NOT_FOUND
/bin/cat << CLANG_NOT_FOUND
===============================================================================
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
Cannot find '$WM_COMPILER' compiler installation

View File

@ -31,22 +31,16 @@
#------------------------------------------------------------------------------
# Fallback value
if [ ! -d "$CEI_HOME" ]
then
export CEI_HOME=/usr/local/ensight/CEI
fi
[ -d "$CEI_HOME" ] || export CEI_HOME=/usr/local/ensight/CEI
if [ -r $CEI_HOME ]
then
# Special treatment for 32bit OpenFOAM and 64bit Ensight
if [ "$WM_ARCH" = linux -a `uname -m` = x86_64 ]
then
export CEI_ARCH=linux_2.6_32
fi
[ "$WM_ARCH-$(uname -m)" = linux-x86_64 ] && export CEI_ARCH=linux_2.6_32
# Add to path if required
if [ "$CEI_HOME/bin/ensight" != "`which ensight 2>/dev/null`" ]
if [ "$CEI_HOME/bin/ensight" != "$(command -v ensight)" ]
then
export PATH=$CEI_HOME/bin:$PATH
fi

View File

@ -73,7 +73,7 @@ then
then
_foamSource "$1"
else
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile -silent "$1")
fi
;;
esac

View File

@ -43,7 +43,7 @@ SYSTEMOPENMPI)
unset OPAL_PREFIX
fi
libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
libDir=$(mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/')
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
# include files and libraries.
@ -56,7 +56,7 @@ SYSTEMOPENMPI)
OPENMPI)
export FOAM_MPI=openmpi-1.10.4
# Optional configuration tweaks:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/openmpi`
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/openmpi)
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
@ -159,7 +159,7 @@ HPMPI)
_foamAddPath $MPI_ARCH_PATH/bin
case `uname -m` in
case $(uname -m) in
i686)
_foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
;;
@ -171,7 +171,7 @@ HPMPI)
_foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
;;
*)
echo Unknown processor type `uname -m` 1>&2
echo Unknown processor type $(uname -m) 1>&2
;;
esac
;;

View File

@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -31,21 +31,21 @@
#------------------------------------------------------------------------------
# Set environment variables according to system type
export WM_ARCH=`uname -s`
export WM_ARCH=$(uname -s)
case "$WM_ARCH" in
Linux)
WM_ARCH=linux
# Compiler specifics
case `uname -m` in
i686)
export WM_ARCH_OPTION=32
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-fPIC'
export WM_CXXFLAGS='-fPIC -std=c++0x'
export WM_LDFLAGS=
case $(uname -m) in
i686)
export WM_ARCH_OPTION=32
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-fPIC'
export WM_CXXFLAGS='-fPIC -std=c++0x'
export WM_LDFLAGS=
;;
x86_64)
@ -68,8 +68,7 @@ Linux)
export WM_LDFLAGS='-m64'
;;
*)
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"\
1>&2
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32|64" 1>&2
;;
esac
;;
@ -111,7 +110,7 @@ Linux)
;;
*)
echo Unknown processor type `uname -m` for Linux 1>&2
echo Unknown processor type $(uname -m) for Linux 1>&2
;;
esac
;;
@ -127,11 +126,11 @@ SunOS)
export WM_LDFLAGS='-mabi=64 -G0'
;;
*) # An unsupported operating system
*) # An unsupported operating system
/bin/cat <<USAGE 1>&2
Your "$WM_ARCH" operating system is not supported by this release
of OpenFOAM. For further assistance, please contact www.OpenFOAM.com
Your "$WM_ARCH" operating system is unsupported by this OpenFOAM release.
For further assistance, please contact www.OpenFOAM.com
USAGE
;;
@ -212,7 +211,7 @@ unset GMP_ARCH_PATH MPFR_ARCH_PATH
# Load configured compiler versions, regardless of the compiler type
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler`
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler)
case "$WM_COMPILER_TYPE" in
system)
@ -227,7 +226,7 @@ OpenFOAM | ThirdParty)
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpc_version:-mpc-system}
# Check that the compiler directory can be found
[ -d "$gccDir" ] || cat << GCC_NOT_FOUND 1>&2
[ -d "$gccDir" ] || /bin/cat << GCC_NOT_FOUND 1>&2
===============================================================================
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
Cannot find '$WM_COMPILER' compiler installation
@ -272,7 +271,7 @@ GCC_NOT_FOUND
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
# Check that the compiler directory can be found
[ -d "$clangDir" ] || cat << CLANG_NOT_FOUND 1>&2
[ -d "$clangDir" ] || /bin/cat << CLANG_NOT_FOUND 1>&2
===============================================================================
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
Cannot find '$WM_COMPILER' compiler installation

View File

@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -143,9 +143,9 @@ unset SCOTCH_ARCH_PATH
if [ -n "$foamClean" ]
then
cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"
cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` && LD_LIBRARY_PATH="$cleaned"
cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"
cleaned=$($foamClean "$PATH" "$foamOldDirs") && PATH="$cleaned"
cleaned=$($foamClean "$LD_LIBRARY_PATH" "$foamOldDirs") && LD_LIBRARY_PATH="$cleaned"
cleaned=$($foamClean "$MANPATH" "$foamOldDirs") && MANPATH="$cleaned"
fi
@ -153,7 +153,6 @@ fi
[ -n "$MANPATH" ] || unset MANPATH
[ -n "$LD_PRELOAD" ] || unset LD_PRELOAD
unset cleaned foamClean foamOldDirs

View File

@ -234,8 +234,8 @@ set cleaned=`$foamClean "$LD_LIBRARY_PATH"`
if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned
#- Clean MANPATH (trailing ':' to find system pages)
set cleaned=`$foamClean "$MANPATH"`:
if ( $status == 0 ) setenv MANPATH "$cleaned"
set cleaned=`$foamClean "$MANPATH"`
if ( $status == 0 ) setenv MANPATH "${cleaned}:"
#- Clean LD_PRELOAD
if ( $?LD_PRELOAD ) then

View File

@ -4,11 +4,9 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
application=`getApplication`
runApplication blockMesh
runApplication extrudeMesh
runApplication $application
runApplication $(getApplication)
#------------------------------------------------------------------------------