From 08fd5157cebf147b40d39de75b33198a1e6f7132 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Mon, 17 Sep 2018 10:52:14 +0800 Subject: [PATCH] update as.sh to support ubuntu. #25 --- bin/as.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/bin/as.sh b/bin/as.sh index e8fd24310..5857fbdd6 100755 --- a/bin/as.sh +++ b/bin/as.sh @@ -1,9 +1,17 @@ -#!/bin/sh +#!/usr/bin/env bash + +# WIKI: https://alibaba.github.io/arthas +# This script only supports bash, do not support posix sh. +# If you have the problem like Syntax error: "(" unexpected (expecting "fi"), +# Try to run "bash -version" to check the version. +# Try to visit WIKI to find a solution. # program : Arthas # author : Core Engine @ Taobao.com -# date : 2017-3-27 -# version : 3.0.3 +# date : 2018-09-17 + +# current arthas script version +ARTHAS_SCRIPT_VERSION=3.0.4 # define arthas's home ARTHAS_HOME=${HOME}/.arthas @@ -17,9 +25,6 @@ TMP_DIR=/tmp # last update arthas version ARTHAS_VERSION= -# current arthas script version -ARTHAS_SCRIPT_VERSION=3.0.2 - # arthas remote url ARTHAS_REMOTE_VERSION_URL="http://search.maven.org/solrsearch/select?q=g:%22com.taobao.arthas%22+AND+a:%22arthas-packaging%22" ARTHAS_REMOTE_DOWNLOAD_URL="http://search.maven.org/classic/remotecontent?filepath=com/taobao/arthas/arthas-packaging" @@ -219,7 +224,7 @@ $(${JAVA_HOME}/bin/jps -l | grep -v sun.tools.jps.Jps) # parse the argument parse_arguments() { - if [ "$1" = "-h" ]; then + if ([ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]) ; then usage exit 0 fi