Unable to grep file in Ubuntu, matching lines are blank? -
i have csv file parsed bash script in order find position of given id within file, means of tracking progress via jmeter.
the specific line i'm having trouble consists of code:
egrep -n -c 2 '49156$'
previously i've run script no problem, think funny has happened character encoding or end line characters. when run line no return.
if change regex check character, such '49156.$'
following in osx , ubuntu:
osx:
1307-node/49150 1308-node/49153 1309:node/49156 1310-node/49159 1311-node/49162
ubuntu:
1307-node/49150 1308-node/49153 1310-node/49159 1311-node/49162
i need script run on ubuntu server, need functioning on that, said, script has run fine previous csvs, i'm not sure how recent csv has become altered.
if @ file in vim using :set list
see following:
node/49153$ node/49156$ node/49159$ node/49162$ node/49165$
i thought check numeric block instead of end line character, using pattern: '49156[^0-9]'
still produces same result:
1307-node/49150 1308-node/49153 1310-node/49159 1311-node/49162
other above, i'm not sure test next. advice :)
it sounds file might using crlf (carriage-return + line-feed) line endings, instead of lf (line-feed). (this might happen if, example, file ever edited on windows machine.) so, i'd suggest running dos2unix
on it, remove stray carriage-returns, , see if fixes it.
Comments
Post a Comment