up, add new config files and delete old tar conf file
[arrow.git] / conf_slk120 / bin / .bin / shell / arrow-init-dir-for-work
blobd8e03ac626d9064fbce59b110b7255af956e6eab
1 #!/bin/sh
2 # change work init dir for user,
3 # 1. set the PWD to /tmp/.arrow/arrow-pwd
4 # 2. run it before start rxvt
6 . arrow-lib
7 NEWPWD=$1
8 ECHO="/bin/echo -e"
9 PWDFILE="${HOME}/.tmp/.arrow-new-pwd"
11 function start
13 arrowbanner
14 if [ "$NEWPWD" = "" ]; then
15 $ECHO "usage:$(basename $0) <newdir>"
16 NEWPWD=`pwd`
17 # exit 1
18 else # check dir exists
19 if [ ! -d "$NEWPWD" ]; then
20 $ECHO "do not exist:[${CL_RED}$NEWPWD${CL_END}], fail"
21 return 500
25 $ECHO -n "set new space:[${CL_GREEN}$NEWPWD${CL_END}] "
26 # $ECHO "#!/bin/sh\nexport ANEWPWD=\"$NEWPWD\"\n" > $PWDFILE 2>/dev/null
27 $ECHO "$NEWPWD" > $PWDFILE 2>/dev/null
28 if [ "$?" = "0" ]; then
29 $ECHO "${CL_YELLOW}success${CL_END}\n"
30 else
31 $ECHO "${CL_RED}fail !${CL_END}\n"
34 # ----
35 start
36 # end