summaryrefslogtreecommitdiffstats
path: root/bin/pbfields
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pbfields')
-rwxr-xr-xbin/pbfields9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/pbfields b/bin/pbfields
index a06bf0b..310a375 100755
--- a/bin/pbfields
+++ b/bin/pbfields
@@ -118,11 +118,12 @@ function quotevals ()
function bashquote (val)
{
-
- if(val ~ /[$'"`]/){
+ if(val ~ /'/){
gsub(/[$"`]/, "\\\\&", val)
return sprintf("\"%s\"", val)
+ }else if(val ~ /[ <>`$"]/){
+ return sprintf("'%s'", val)
+ }else{
+ return val
}
- if(val ~ /[ <>]/) return sprintf("'%s'", val)
- return val
}