From 14f1557b8ce33b4637464e48a199cf40c274cac4 Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Thu, 21 Feb 2002 14:15:28 +0000 Subject: [PATCH] * lib/cedit.menu: Eliminate bashisms. Add missed `:' in AUTHOR evaluation. Unset LANGUAGE and make LC_ALL empty. Use "#! /path/to/program". --- ChangeLog | 7 +++++ lib/cedit.menu | 70 ++++++++++++++++++++++++++++---------------------- 2 files changed, 46 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 266f10a4b..329d3e12e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-02-21 Andrew V. Samoilov + + * lib/cedit.menu: Eliminate bashisms. + Add missed `:' in AUTHOR evaluation. + Unset LANGUAGE and make LC_ALL empty. + Use "#! /path/to/program". + 2002-02-20 Andrew V. Samoilov * doc/mc.1.in (FILES): Use ~/.mc/bindings instead of diff --git a/lib/cedit.menu b/lib/cedit.menu index 568003ad9..ddbb143c7 100644 --- a/lib/cedit.menu +++ b/lib/cedit.menu @@ -35,16 +35,18 @@ shell_patterns=0 # expression type + y Perl\ Program | f \.pl$ 1 Author description header unset LANG - AUTHOR="$(cat /etc/passwd |grep ^$(id -un) |awk -F: '{print($5)}')" + unset LANGUAGE + LC_ALL= + AUTHOR="`awk -F: /^\`id -un\`:/'{print($5)}' /etc/passwd`" cat >>%b < - # Created at: $(date) - # Computer: $(uname -n) - # System: $(uname -sr) on $(uname -m) + # Author: $AUTHOR <$REPLYTO> + # Created at: `date` + # Computer: `uname -n` + # System: `uname -sr` on `uname -m` # - # Copyright (c) $(date +%%Y) $AUTHOR All rights reserved. + # Copyright (c) `date +%%Y` $AUTHOR All rights reserved. # #---------------------------------------------------------------------- # Configure section: @@ -124,16 +126,18 @@ a sub () + y Shell\ Script | f \.sh$ 1 Author description header unset LANG - AUTHOR="$(cat /etc/passwd |grep ^$(id -un) |awk -F: '{print($5)}')" + unset LANGUAGE + LC_ALL= + AUTHOR="`awk -F: /^\`id -un\`:/'{print($5)}' /etc/passwd`" cat >>%b < - # Created at: $(date) - # Computer: $(uname -n) - # System: $(uname -sr) on $(uname -m) + # Author: $AUTHOR <$REPLYTO> + # Created at: `date` + # Computer: `uname -n` + # System: `uname -sr` on `uname -m` # - # Copyright (c) $(date +%%Y) $AUTHOR All rights reserved. + # Copyright (c) `date +%%Y` $AUTHOR All rights reserved. # #---------------------------------------------------------------------- # Configure section: @@ -214,16 +218,18 @@ a sub () + f \.h$ | f \.c$ | f \.cc$ 1 Author description header unset LANG - AUTHOR="$(cat /etc/passwd |grep ^$(id -un) |awk -F: '{print($5)}')" + unset LANGUAGE + LC_ALL= + AUTHOR="`awk -F: /^\`id -un\`:/'{print($5)}' /etc/passwd`" cat >> %b < - * Created at: $(date) - * Computer: $(uname -n) - * System: $(uname -sr) on $(uname -m) + * Author: $AUTHOR <$REPLYTO> + * Created at: `date` + * Computer: `uname -n` + * System: `uname -sr` on `uname -m` * - * Copyright (c) $(date +%%Y) $AUTHOR All rights reserved. + * Copyright (c) `date +%%Y` $AUTHOR All rights reserved. * ********************************************************************/ EOF @@ -403,26 +409,28 @@ t Indent `C' formatter #------------------------- Begin unknown template ----------------------------- + y unknown & t r -s #!/bin/sh - echo "#!/bin/sh" >%b +s #! /bin/sh + echo "#! /bin/sh" >%b + y unknown & t r -p #!/usr/bin/perl - echo "#!/usr/bin/perl" >%b +p #! /usr/bin/perl + echo "#! /usr/bin/perl" >%b + y unknown & t r a Author description header unset LANG - AUTHOR="$(cat /etc/passwd |grep ^$(id -un) |awk -F: '{print($5)}')" + unset LANGUAGE + LC_ALL= + AUTHOR="`awk -F: /^\`id -un\`:/'{print($5)}' /etc/passwd`" cat >>%b < - Created at: $(date) - Computer: $(uname -n) - System: $(uname -sr) on $(uname -m) + Author: $AUTHOR <$REPLYTO> + Created at: `date` + Computer: `uname -n` + System: `uname -sr` on `uname -m` - Copyright (c) $(date +%%Y) $AUTHOR All rights reserved. + Copyright (c) `date +%%Y` $AUTHOR All rights reserved. ---------------------------------------------------------------------- EOF @@ -432,9 +440,9 @@ a Author description header #----------------------- Begin common section --------------------------------- I Insert `Changelog' string - DATE=$(date +%%Y-%%m-%%d) - AUTHOR="$(cat /etc/passwd |grep ^$(id -un) |awk -F: '{print($5)}')" - EMAIL="<$(echo -ne $REPLYTO)>" + DATE="`date +%%Y-%%m-%%d`" + AUTHOR="`awk -F: /^\`id -un\`:/'{print($5)}' /etc/passwd`" + EMAIL="<$REPLYTO>" echo "$DATE $AUTHOR $EMAIL" >%b s Invoke `shell'