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 7947403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:25:18+00:00 2026-06-04T01:25:18+00:00

I have been trying to run Linux shell script on Windows machine. to run

  • 0

I have been trying to run Linux shell script on Windows machine. to run the script on windows environment, i have selected Cygwin.

when i first started running the script using cygwin, i first faced following issue.

line 12: $'\r': command not found

but line number 12 does not have any command

  08  #
  09  ######################################################################
  10  #### PARAMETERS TO SET BEGIN
  11  ######################################################################
  12  
  13  # archive setttings
  14  ARCHIVE_USER=abc                      # archive storage user name  (default)
  15  ARCHIVE_GROUP=app                     # archive storage user group (default)
  16  ARCHIVE_PATH=/test/file               # archive storage directory (default)
  17  ARCHIVE_DELAY=+8

To solve this issue used dos2unix command and generated new shell scrip from the old one

when i run this newly generated scrip it again returns an error

housekeeper.sh: 2: Syntax error: newline unexpected

following is the dos2unix generated script.

>#!/bin/bash
>>#
>># Date  : 2012-03-22 (yyyy-mm-dd)

could somebody explain me what is wrong with the line number2 here.

thanks in advance for any help

Following is top of the script i am trying to run , this is the script i get after converting using dos2unix command

>#!/bin/bash
>>#
>># Date  : 2012-03-22 (yyyy-mm-dd)
>># Modified by   : ABC
>># Goal          : Draft version for X house keeping environment
>>#
>># Description : This script perform housekeeping of XYS products.
>>#
>>######################################################################
>>#### PARAMETERS TO SET BEGIN
>>######################################################################
>>
>># archive setttings
>>ARCHIVE_USER=user1                               # archive storage user name (default)
>>ARCHIVE_GROUP=gapp                              # archive storage user group (default)
>>ARCHIVE_PATH=/product/file                        # archive storage directory (default)
>>ARCHIVE_DELAY=+8                              # archive files older than delay (in days)
>>
>># purge setttings
>>PURGE_DELAY=+30                                   # purge files older than delay   (in days)
  • 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-04T01:25:20+00:00Added an answer on June 4, 2026 at 1:25 am

    That sounds like a line termination issue (Windows uses Carriage Return, Linefeed and Unix uses just Linefeed). You can correct these issues using dos2unix (and unix2dos), which converts the line terminators.

    Try:

    $ dos2unix myscript.sh
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to run some java programs from a bash script in
I've been trying to optimize a numeric program of mine, and have run into
I have been trying to run configure to prepare the make file for GTK
I have been trying to run rake but it seems that ever since I
I have been trying to run the project given in this MSDN Magazine but
I have been trying to get a simple networking test program to run with
I have been trying to run a video from my app in iOS 4.1
I have been trying to run the rake db:migrate command but it ain't working.
I have been trying to run this query: my_post = db.GqlQuery(SELECT * FROM Post
Have have been trying to make a validator for my xml files. I have

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.