0

Script:

#!/bin/bash

line_num=349

pattern_2="$(sed -n "${line_num}p" ssg_ds_5%.csv | awk 'BEGIN {FS= ","}; {print $9}')"

echo "$pattern_2"

Error:

")syntax error: invalid arithmetic operator (error token is "209
'ed: -e expression #1, char 4: unknown command: `

The sed command is supposed to run in a loop and extract one line from a csv file. It works fine when I give the command from the terminal, but when I run the script, I receive this error.

Any help will be greatly appreciated. TIA

Shafquat
  • 1
  • 1

0 Answers0