Med Zamrik
Med Zamrik

Reputation: 323

Why do I have end of file error here?

This is a linux script shell and I am running it on Ubuntu 13.1 I get a line 9: syntax error: unexpected end of file when I run the script. here is my script:

!#/bin/bash
x=$(stat --printf="%a\n" hi1.txt)
y=$(stat --printf="%a\n" hi1copy.txt)
echo "$x"
echo "$y"
if [ "$x" == "$y" ]; then
  echo "same la!"
fi

Upvotes: 0

Views: 49

Answers (2)

Korplex
Korplex

Reputation: 164

Try to run it with the dos2unix cmd.

dos2unix yourfile.sh

Check this.

Upvotes: 1

andyf
andyf

Reputation: 3350

Change:

!#/bin/bash

to

#!/bin/bash

Upvotes: 5

Related Questions