From bcf3c95bd2a1ab8876c6527b6eca3ad08eff3e1d Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Tue, 17 Oct 2023 15:48:42 +0900 Subject: [PATCH] cyr_cd.sh: change to POSIX sh style `function` keyword is not required to declare functions. Additionally, prevent to overwrite global scope variables. Signed-off-by: OBATA Akio --- imap/cyr_cd.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/imap/cyr_cd.sh b/imap/cyr_cd.sh index 9fdfbb56ac..0eebeff47d 100644 --- a/imap/cyr_cd.sh +++ b/imap/cyr_cd.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # cyr_cd -- Shell script to change directory within a mailbox spool # @@ -44,10 +44,10 @@ # This script should be sourced from the command line or from within .bashrc -function cyr_cd() { - path=`mbpath $@` - if test ${#path} -ne 0 +cyr_cd() { + set -- `mbpath $@` + if test $# -ne 0 then - cd $path + cd "$@" fi }