Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ext/session/mod_files.sh fix #265

Closed
wants to merge 2 commits into from

5 participants

@b1lb0

Patch for line 13 "integer expression expected".

Tested in bash from mac os, centos, redhat

Added some facility and feedback

@b1lb0 b1lb0 Fix for line:13 integer expression expected
Patch for line 13. Tested from mac os, centos, redhat

Added some facility and feedback
b3d0cba
@lstrojny

Looks good. Thanks!

@smalyshev
Owner

This patch changes non-interactive script to interactive-by-default script. Not sure it's a good idea. It may be used in some packages to do some things non-interactively, so maybe it's better to keep it non-interactive, at least by default?

@lstrojny

@b1lb0 @smalyshev has a point. Can we keep it non-interactive per default?

@b1lb0

Yes of course @smalyshev and @lstrojny, i will make another pull request with this fix

@b1lb0 b1lb0 Fixed execution for non interactive shell
Added check for interactive terminal. If the terminal is interactive
then prompt is shown.
3cfecef
@b1lb0

Code executed and tested in mac os x, centos and redhat.

@yohgaki

I've committed other patch to repository days ago. If it does not work for you, please submit new pull request. Thank you.

@php-pulls
Collaborator

Comment on behalf of yohgaki at php.net:

Other fix is committed.

@php-pulls php-pulls closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 22, 2013
  1. @b1lb0

    Fix for line:13 integer expression expected

    b1lb0 authored
    Patch for line 13. Tested from mac os, centos, redhat
    
    Added some facility and feedback
Commits on Jan 31, 2013
  1. @b1lb0

    Fixed execution for non interactive shell

    b1lb0 authored
    Added check for interactive terminal. If the terminal is interactive
    then prompt is shown.
This page is out of date. Refresh to see the latest.
Showing with 27 additions and 6 deletions.
  1. +27 −6 ext/session/mod_files.sh
View
33 ext/session/mod_files.sh 100644 → 100755
@@ -1,5 +1,4 @@
-#! /bin/sh
-
+#!/bin/sh
if test "$2" = ""; then
echo "usage: $0 basedir depth"
exit 1
@@ -9,16 +8,38 @@ if test "$2" = "0"; then
exit 0
fi
+if test -z "$3"; then
+ param3=0
+
+ #Test of interactive shell terminl
+ if tty -s; then
+ echo "Are you sure to create sessions tree dirs
+in $1 root path with $2 depth? (Y|N)"
+ read input
+ if test "$input" != "Y"; then
+ echo "Exit without process"
+ exit 0
+ fi
+ fi
+ echo "$0: Processing $1 with $2 depth...."
+else
+ param3=$3
+fi
+
hash_chars="0 1 2 3 4 5 6 7 8 9 a b c d e f"
-if test "$3" -a "$3" -ge "5"; then
+if test "$param3" -a "$param3" -ge "5"; then
hash_chars="$hash_chars g h i j k l m n o p q r s t u v"
- if test "$3" -eq "6"; then
+ if test "$param3" -eq "6"; then
hash_chars="$hash_chars w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - ,"
fi
fi
for i in $hash_chars; do
newpath="$1/$i"
- mkdir $newpath || exit 1
- sh $0 $newpath `expr $2 - 1` $3
+ mkdir -p $newpath || exit 1
+ sh $0 $newpath `expr $2 - 1` $param3
done
+
+if test -z "$3"; then
+ echo "$0: Done"
+fi
Something went wrong with that request. Please try again.