-2

I have this simple code to execute, but have failed.

a.csh

#! /bin/csh -f

`perl a.pl`

a.pl

#use perl
    eval 'exec perl -w -S $0 ${1+"$@"}'
    if 0;

use Cwd;

print "here.\n";

When I run a.csh, it reports an error as below.

here: Command not found

I am not sure what that means; any suggestion is welcome.

Rocky Zheng
  • 31
  • 1
  • 10
  • 2
    Please share more details. Provide code in .csh file, so that, we can see what are you trying to do and possible syntax errors. – JayC Apr 11 '18 at 17:19
  • Is that the *exact contents* of the two files? Please check. – Borodin Apr 11 '18 at 18:03
  • actually not too much related code in these files. I pasted all code I have below. ( I paste the code in the original text ,not in comment ) – Rocky Zheng Apr 11 '18 at 18:08

1 Answers1

0

The backticks in your program are returning the output of the perl script. Then csh tries to execute that output as csh. toolic's comment telling you to remove the backticks is correct: perl a.pl. Reading more about how backticks work might be useful.

kingsfoil
  • 3,795
  • 7
  • 32
  • 56