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

  • SEARCH
  • Home
  • 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 8270567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:36:28+00:00 2026-06-08T06:36:28+00:00

Here’s the deal. I’ve got cygwin installed in Win7 envionment. This is the sequence

  • 0

Here’s the deal. I’ve got cygwin installed in Win7 envionment. This is the sequence of things I would do in a command line and everything works,

File mpc.exe is a 64-bit executable created by Intel Fortran Compiler

cp ./dir1/dir2/mpc.exe ./mpc.exe
./mpc.exe arg1 arg2

everything is fine

Want to create a script for that. The reason is I will want to execute the code for various values of arg2. file “script_mpc.sh” contains following,

#!/bin/sh
cp ./dir1/dir2/mpc.exe ./mpc.exe
./mpc.exe arg1 arg2
wait
return_val=$?
[ $retval -eq 0 ] && echo "successfully executed "

Now back at the command line,

$>chmod +x script_mpc.sh
$>./script_mpc.sh

error:

./script_mpc.sh: line 2: ./mpc.exe: No such file or directory

A very fresh beginner. Learning shell commands and scripting on the go. Please help.

  • 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-08T06:36:32+00:00Added an answer on June 8, 2026 at 6:36 am

    You’re on Cygwin.

    I’ll bet that this line:

    cp ./dir1/dir2/mpc.exe ./mpc.exe
    

    has a Windows-style CR-LF line ending. The shell (either sh or bash) interprets the CR as part of the filename, so it copies the file to "./mpc.exe\r".

    Filter the script through dos2unix. Be sure to read the man page first; unlike most text filters, it normally overwrites the input file.

    Background:

    Unix uses a single ASCII LF character to mark the end of a line in a text file. Windows uses a CR-LF pair. Cygwin is a Unix-like emulation layer on top of Windows, so it tends to be a rich source of problems with conflicting end-of-line representations.

    Unix shells, in particular, typically don’t recognize the CR as part of an end-of-line indicator; instead, they treat it as just another character — one that tends to be invisible, depending on how you look at the file.

    You probably have a mixture of LF and CR-LF line endings. If it used CR-LF endings consistently, then the #!/bin/sh or #!/bin/bash line wouldn’t be recognized.

    If possible, use only Unix-style editors (vim, emacs, nano, or whatever you prefer) to edit shell scripts. If you create a script using, say, Notepad or Wordpad, you’re likely to run into this kind of problem.

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

Sidebar

Related Questions

Here is the code in a function I'm trying to revise. This example works
Here is an example. foreach (var doc in documents) { var processor = this.factory.Create();
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is the css: #content ul { font-size: 12px; } I am trying this:
I know there's a lot of other questions out there that deal with this
Here is my code, i have wasted lot of time on this but still
Here's a coding problem for those that like this kind of thing. Let's see
Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE
Here is what I am trying to achieve in PHP: I have this string:
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }

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.