Skip to content

Commit

Permalink
cyr_cd.sh: change to POSIX sh style
Browse files Browse the repository at this point in the history
`function` keyword is not required to declare functions.
Additionally, prevent to overwrite global scope variables.

Signed-off-by: OBATA Akio <[email protected]>
  • Loading branch information
obache committed Oct 17, 2023
1 parent ef6fe77 commit bcf3c95
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions imap/cyr_cd.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# cyr_cd -- Shell script to change directory within a mailbox spool
#
Expand Down Expand Up @@ -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
}

0 comments on commit bcf3c95

Please sign in to comment.