home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10133 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  2.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!wupost!sdd.hp.com!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!mp.cs.niu.edu!fnnews!fnsony.fnal.gov!shah
  2. From: shah@fnsony.fnal.gov (Hemant Shah)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: problem with vi..
  5. Message-ID: <2195@fnnews.fnal.gov>
  6. Date: 17 Aug 92 17:38:57 GMT
  7. References: <1992Aug17.155121.21926@njitgw.njit.edu>
  8. Sender: news@fnnews.fnal.gov
  9. Reply-To: shah@fnalb.fnal.gov
  10. Organization: Fermi National Accelerator Laboratory, Batavia, IL
  11. Lines: 51
  12. Nntp-Posting-Host: fnsony.fnal.gov
  13.  
  14. In article <1992Aug17.155121.21926@njitgw.njit.edu>, cxk6819@hertz.njit.edu (K. Chandrakanth) writes:
  15. |> Dear netters,
  16. |>      I have a sparc workstation 2.
  17. |> I mounted the floppy drive and copied few files from the floppy. But
  18. |> when I viewed through vi I happened to see ^M at the end of each line.
  19. |> When I cat the file it looks normal. Will some one tell me the reason
  20. |> for this. If possible please send me a shell script or small c program
  21. |> to remove this. I am enclosing a sample of the file.
  22. |> 
  23. |>     But when I compile the file it works fine. The control characters
  24. |> are really irritating. So help me.
  25. |> 
  26. |> struct employee {^M
  27. |>     e_type typer;^M
  28. |>     employee *next;^M
  29. |>     char name[20];^M
  30. |>     short department;^M
  31. |> };^M
  32. |> ^M
  33. |> struct manager:employee {^M
  34. |>         employee* group;^M
  35. |>         short level;^M
  36. |> };^M
  37. |> void print_emp(employee *);^M
  38. |> void f(employee *);^M
  39. |> void print_emp(employee *e)^M
  40. |> {^M
  41. |> 
  42. |> Please email to me. Thanks in advance...
  43. |> 
  44. |> cxk6819@hertz.njit.edu
  45. |> 
  46. |> -- 
  47. |> god's theorem:
  48. |>         those who sow in tears will reap in joy.
  49.  
  50. vi the file and type following vi command:
  51.  
  52. :%s/^VM//g
  53.  
  54.  
  55. where '^V' is one character <Ctrl>V
  56. -- 
  57. -------------------------------------------------------------------------------
  58. Hemant Shah                            | All the opinions expressed are my own
  59. Fermi National Accelerator Laboratory  | and does not necessarily reflect
  60. Systems Integration Group              | those of Fermilab.
  61. E-mail :shah@fnal.fnal.gov             |
  62.  Voice : (708) 840-8071                   | I haven't lost my mind
  63.    Fax : (708) 840-2783                | it's backed on tape somewhere.
  64. -------------------------------------------------------------------------------
  65.