if [ "${FXML_line:1129:1}" = "S" -o "${FXML_line:1129:1}" = "H" ]
It is working fine if I run it in a test file.
but not working, when I am trying in my actual script.
Error:
: "${FXML_line:1129:1}": bad substitution
Thanks in advance
PS: Above if block I have a while loop which is reading a file into FXML_line but while reading that file, it doesn't read <tab>
fo example if the line in the file is like "<tab>;<tab>;abcdefgh;123456" then it is reading "; ;abcdefgh;123456". What is the reason behind this behavior and how can I overcome this.
Please state what Operating System and version you are running and what Shell you are using. Because your syntax is unusual, please do this on every thread you open.
Please show the actual script with sample input data and expected output data.
Please explain what you expect from: ${FXML_line:1129:1}
This is Unix with Korn Shel and the command is used to cut 1130th character from a line. The command is working if I am using standalone but not inside the loop.
Though I have achieved that using awk but the reading of file by the loop is annoying. It is removing tabs in the line
for example:
; ;COMP; ; ; ;
to:
; ;COMP; ; ; ; ;
Loop is like this:
while read FXML_line
do
done < "${PREPAVAL_TRAVAIL}/${FXML_index}"