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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:48:38+00:00 2026-05-26T11:48:38+00:00

Hello I am trying to run this script in cygwin and it’s not working

  • 0

Hello I am trying to run this script in cygwin and it’s not working correctly. It works fine when running under linux though.

The error:

$ ./script2.txt >> count.txt
./script2.txt: line 3: syntax error near unexpected token `|'
'/script2.txt: line 3: `    | grep PlayerCount \

Original script:

#!/usr/bin/bash
wget --output-document=- http://runescape.com/title.ws 2>/dev/null \
    | grep PlayerCount \
    | head -1l \
    | sed 's/^[^>]*>//' \
    | sed "s/currently.*$/$(date '+%r %b %d %Y')/"

What someone asked for:

$ od -a script2.txt
0000000   #   !   /   u   s   r   /   b   i   n   /   b   a   s   h  cr
0000020  nl   w   g   e   t  sp   -   -   o   u   t   p   u   t   -   d
0000040   o   c   u   m   e   n   t   =   -  sp   h   t   t   p   :   /
0000060   /   r   u   n   e   s   c   a   p   e   .   c   o   m   /   t
0000100   i   t   l   e   .   w   s  sp   2   >   /   d   e   v   /   n
0000120   u   l   l  sp   \  cr  nl  sp  sp  sp  sp   |  sp   g   r   e
0000140   p  sp   P   l   a   y   e   r   C   o   u   n   t  sp   \  cr
0000160  nl  sp  sp  sp  sp   |  sp   h   e   a   d  sp   -   1   l  sp
0000200   \  cr  nl  sp  sp  sp  sp   |  sp   s   e   d  sp   '   s   /
0000220   ^   [   ^   >   ]   *   >   /   /   '  sp   \  cr  nl  sp  sp
0000240  sp  sp   |  sp   s   e   d  sp   "   s   /   c   u   r   r   e
0000260   n   t   l   y   .   *   $   /   $   (   d   a   t   e  sp   '
0000300   +   %   r  sp   %   b  sp   %   d  sp   %   Y   '   )   /   "
0000320
  • 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-05-26T11:48:39+00:00Added an answer on May 26, 2026 at 11:48 am

    You need your file NOT to have windows-style line endings.

    dos2unix script2.txt script2.txt
    

    Or, set the line endings with your editor. For example, in vim, you’d use :set ff=unix

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get this jGrowl working but I am not having any
I'm trying to run through the Hello World tutorial for the iPhone and i
So I'm trying to run my first hello world prog written in C. I
Hello I'm trying something .. I was reading Jquery traversing documentations some forums, this
Hello everyone I am trying to resize an image of 700kb with imagecreatefromjpeg. This
I'm trying to run sample Perl script on Windows 7 and I configured IIS
Im trying to run a sipmle ASP.NET 2 Webmethod with JSON this is my
I am trying to run a simple cgi script after configuring my server. My
I am trying to create a script that will run a program on each
I'm trying to run some java script just before a page redirect but it

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.