我想寫一個fgrep語句從文件中刪除具有完整記錄匹配的記錄。我可以在命令行上執行此操作,但不能在ksh腳本中執行此操作。我使用的代碼歸結於這4行代碼: Header='abc def|ghi jkl' #I use the head command to populate this variable
workfile=abc.txt
command="fgrep -Fxv
我有一個testFile,它有兩個由pipe分隔的參數。 vi testFile
1|A
2|B
3|C
4|D
5|E
我創建地圖,運行它在一個for循環,如下工作: while IFS='|' read -r NUM CHAR
do
export MAP[$NUM]=$CHAR
done < testFile
for i in ${!MAP[@]}
do
我在寫一個截斷表的腳本。問題在於腳本無限循環。 ./n_input包含在腳本中使用的環境變量。 #!/bin/ksh
INPUT_FILE=./n_input
if [ ! -e $INPUT_FILE ];
then
echo "Error: Input file require"
exit 1
fi
source $INPUT_FILE
while r