X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=command_util.sh;h=62ad96638c16c56b1a010f662d1affb4accf0bc1;hp=ad75c9b575680bc7c6310610ffece6dc358cbfd5;hb=68f0d202714b85c9b5e649dcefc41df58fe8e31e;hpb=c31f2422a6f4dd8e3041788990bd138b29b85c3a diff --git a/command_util.sh b/command_util.sh index ad75c9b5..62ad9663 100755 --- a/command_util.sh +++ b/command_util.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash read_header() @@ -148,7 +148,7 @@ dump_man() local t_name_txt=$(echo $name_txt | $sed_cmd) echo ".SS \"$t_name_txt\"" done - echo "$desc_txt" + echo "$desc_txt" | sed -e "s/@member@/{$(echo $template_members | sed -e 's/ / | /g')}/g" echo echo "\\fBUsage: \\fP" echo @@ -241,7 +241,7 @@ dump_array_member() echo ".description = \"$desc_txt\"," echo ".usage = \"$usage_txt\"," echo ".help = " - echo "$help_txt" | sed -e 's/^/\"/g' -e 's/$/\\n\"/g' + printf "%s\n" "$help_txt" | sed -e 's/^/\"/g' -e 's/$/\\n\"/g' echo '},' } @@ -263,7 +263,7 @@ template_loop() perms_txt=$(echo $t_perms | $sed_cmd) desc_txt=$(echo $t_desc | $sed_cmd) usage_txt=$(echo $t_usage | $sed_cmd) - help_txt=$(echo $t_help | $sed_cmd) + help_txt=$(printf "%s\n" "$t_help" | $sed_cmd) prototype=$(echo "$template_prototype" | $sed_cmd) $1 done