special characters in run scripts

If u create a run script in windows and trying to use it in linux, you may see some weird things happening. Problem can be from the special characters that windows use. There are some solutions for this.

1. #include <stdio.h>
main(){
   int i; 
   while((i=getchar())!=EOF)
   if(i=='\t'||i=='\n'||i>=040&&i<=0177) putchar(i);
}
 $ cc temp.c (or whatever you call the above)
 $ a.out < oldfile > newfile

2. Do set list in vi and then remove spcl characters

1 comment: