I have a file formated like below:436541,000454056,Smith,john,jsmith,j-Smith@xxx.comI want to extract out ,jsmith and write it to another file test.txt.So I use:grep -o '\,[a-z][a-z0-9]{1,7}' source.txt > test.txtfrom the command line and it works fine.when I use it from a shell script the test.txt file is empty#!/bin/bashgrep -o '\,[a-z][a-z0-9]{1,7}' source.txt > test.txtany suggestions?
Works on command line but not in shell script
shell script;grep