被这些shell变量搞的很失败啊

来源:互联网 发布:机票出票端口 编辑:程序博客网 时间:2024/05/15 02:35



#!/bin/sh


HELLO="HELLO"
WORLD="WORLD"
NAME="ZHANGBIN"


echo "HELLO IS $HELLO"
SUN=$WORLD
#"${WORLD}""${NAME}"
echo "SUN IS $SUN"
SUN+=$NAME
echo "SUN2 IS $SUN"
unset SUN
SUN=$(echo "$WORLD$HELLO$NAME")
echo "sun3 is $SUN"
#export HELLO+="${WORLD}"
#echo "parameter 1 is $HELLO"
SKAV_UTILS_LIB_LIST=-list
LIBS=11
LIBS+=22
LIBS+=33
export LIBS="$LIBS -L${SKAV_LIST_LIB}"
echo "###$LIBS"



root@Ubuntu64:/home/zhangbin/codeStore/testReplaceOneLine# sh test.sh

HELLO IS HELLO
SUN IS WORLD
test.sh: 11: test.sh: SUN+=ZHANGBIN: not found
SUN2 IS WORLD
sun3 is WORLDHELLOZHANGBIN
test.sh: 20: test.sh: LIBS+=22: not found
test.sh: 21: test.sh: LIBS+=33: not found
###11 -L

root@Ubuntu64:/home/zhangbin/codeStore/testReplaceOneLine# 




原创粉丝点击