Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8859503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:04:43+00:00 2026-06-14T15:04:43+00:00

I have a script on a centos server and I wrote the script on

  • 0

I have a script on a centos server and I wrote the script on the server using VIM. The script is to edit a configuration file. When I check the configuration file after it has been edited, there is a ^M at the end of every line that was NOT edited. The lines that were edited are fine.

        cat hibernate.properties | 
    sed -i.bk \
    -e 's%\(^hibernate\.connection\.url\=ristor:jdbc:postgresql:\/\/127\.0\.0\.1/\).*%\'1$dbname'%' \
    -e 's/\(^hibernate\.connection\.username\=\).*/\'1$dbuser'/' \
    -e 's/\(^hibernate\.connection\.password\=\).*/\'1$pws'/' hibernate.properties

This is the code that is being used to edit the configuration file. Why is it putting ^M at the end of every line that is NOT edited?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:04:44+00:00Added an answer on June 14, 2026 at 3:04 pm

    The ^M being shown are probably windows-style line endings on some lines. Try to run your file through dos2unix before running your script.

    For example:

    dos2unix hibernate.properties
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a python script to monitor a log file on a CentOS server
I have script that reads remote file content and writes it to local server.
I have a question. I have a script that handles file upload, and after
i have a bash script I edit on windows using UltraEdit and save as
On my Centos 6.2 I have this bash script: [le_me]$ cat get.nb #! /bin/bash
I have script file where a command is stored in a variable First i
I have an script interpreter that is spawn by a deamon and has to
I have a web site hosted in a CentOS 5-Plesk-Apache server. I have recently
We have an application that has been deployed to 50+ websites. Across these sites
I have been going nuts with this.. I have gnupg installed on my CentOS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.