cht電腦資訊gcin
adm Find login register

修改字詞

guest
1subject: 修改字詞Promote 0 Bookmark 02009-01-31quote  

狀況:

      修改字詞,永遠無法修改成功
      utf8 editor: gvim

 

確認原因:

修改字詞的指令
exec ( cd ~/.gcin && /usr/bin/tsd2a32 tsin32 > tmpfile && /usr/share/gcin/script/utf8-edit tmpfile && /usr/bin/tsa2d32 tmpfile ) &

在/usr/share/gcin/script/utf8-edit tmpfile 時候,並不會停住等gvim修改完畢,會直接進行
/usr/bin/tsa2d32 tmpfile 這個指令
讓我永遠無法更新.....

請問有沒有解法?

eliu

joined: 2007-08-09
posted: 11482
promoted: 617
bookmarked: 187
新竹, 台灣
2subject: 修改字詞Promote 0 Bookmark 02009-02-01quote  

guest
在/usr/share/gcin/script/utf8-edit tmpfile 時候,並不會停住等gvim修改完畢,會直接進行

用 gvim -f 就會 foreground 

edited: 1
guest
3subject: Promote 0 Bookmark 02009-02-01quote  

 

感謝 這個問題困擾我很久
一直到昨天我才確認問題所在

提供我的作法,在/usr/share/gcin/script/utf8-edit中
6~12行的第9行,變數多加上" -f"

 6 do
 7   which $i >& /dev/null
 8   if [ $? = 0 ]; then
 9     UTF8ED=$i" -f"
10     break
11   fi
12 done
 

ps
其他的編輯器我都未裝(目前只有安裝gvim的情況)
所以還未能確認其他的情況

eliu

joined: 2007-08-09
posted: 11482
promoted: 617
bookmarked: 187
新竹, 台灣
4subject: Promote 0 Bookmark 12009-02-01quote  

utf8-edit 改成這樣 

#!/bin/bash

PATH=$PATH:/opt/gnome/bin:/usr/local/bin

for i in madedit gedit leafpad kedit kate gvim
do
  which $i >& /dev/null
  if [ $? = 0 ]; then
    UTF8ED=$i
    break
  fi
done

export LC_CTYPE=zh_TW.UTF-8
export LC_ALL=zh_TW.UTF-8

if [ $UTF8ED = 'gvim' ]; then
  UTF8ED='gvim -f'
fi

$UTF8ED $1

guest
5subject: Promote 0 Bookmark 02009-02-01quote  
eliu

#!/bin/bash

PATH=$PATH:/opt/gnome/bin:/usr/local/bin

for i in madedit gedit leafpad kedit kate gvim
do
  which $i >& /dev/null
  if [ $? = 0 ]; then
    UTF8ED=$i
    break
  fi
done

export LC_CTYPE=zh_TW.UTF-8
export LC_ALL=zh_TW.UTF-8

if [ $UTF8ED = 'gvim' ]; then
  UTF8ED='gvim -f'
fi

$UTF8ED $1

太棒了 這樣的確是比較make sense!!!!!
小弟我shell script 懂的實在不多阿 ^^"";

cht電腦資訊gcin
adm Find login register
views:12690