Resolved by executing the command in the below manner cd /path/;grep policy# filename;
just by executing cd /path/ the directory will not change and cursor wont stay in that directory, next time when you execute a separate command that command will execute in home directory only.
So always combined the command with change directory command