# Command not found errors when running csh script

**URL:** <https://community.unix.com/t/command-not-found-errors-when-running-csh-script/282984>\
**Category:** Shell Programming and Scripting\
**Created:** [February 17, 2011, 6:32am UTC](https://community.unix.com/t/command-not-found-errors-when-running-csh-script/282984 "2011-02-17T06:32:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiten.r.chauhan](https://community.unix.com/letter_avatar/hiten.r.chauhan/32/6_449c533f586939b6e5f246632a46421f.png) [@hiten.r.chauhan](https://community.unix.com/u/hiten.r.chauhan)\
**Post date:** [February 17, 2011, 6:32am UTC](https://community.unix.com/t/command-not-found-errors-when-running-csh-script/282984/1 "2011-02-17T06:32:09Z")

</div>

I am trying to find the number of files whose name starts with uni.  
Below is the code but it is giving error. 😕

```nohighlight
#!/bin/csh
FILES_NAME ='files_list';
FILE_NAME_PATTERN = 'uni*';
NO_OF_FILES;
ls -l $FILE_NAME_PATTERN > $FILES_NAME ;
NO_OF_FILES = `wc -l $FILES_NAME`;
echo $NO_OF_FILES;

```

When run give the following warnings.

```nohighlight
$ ./unix_4.sh
FILES_NAME: Permission denied.
FILE_NAME_PATTERN: Command not found.
NO_OF_FILES: Command not found.
FILE_NAME_PATTERN: Undefined variable.
$

```

But when the following commands are issued

```nohighlight
ls -l uni* > files_list and
wc -l files_list 

```

runs perfectly.

What is the problem 😕😕

---

<div class="post-metadata">

**Author:** ![ctsgnb](https://community.unix.com/letter_avatar/ctsgnb/32/6_449c533f586939b6e5f246632a46421f.png) [@ctsgnb](https://community.unix.com/u/ctsgnb)\
**Post date:** [February 17, 2011, 7:13am UTC](https://community.unix.com/t/command-not-found-errors-when-running-csh-script/282984/2 "2011-02-17T07:13:58Z")

</div>

You should have NO space before and after the sign `=`

in `csh` , you should use

```nohighlight
set var=value

```

for example:

```nohighlight
set FILES_NAME='files_list'

```

and remove the line:

```nohighlight
NO_OF_FILES;

```

---

<div class="post-metadata">

**Author:** ![hiten.r.chauhan](https://community.unix.com/letter_avatar/hiten.r.chauhan/32/6_449c533f586939b6e5f246632a46421f.png) [@hiten.r.chauhan](https://community.unix.com/u/hiten.r.chauhan)\
**Post date:** [February 17, 2011, 7:38am UTC](https://community.unix.com/t/command-not-found-errors-when-running-csh-script/282984/3 "2011-02-17T07:38:47Z")

</div>

For the same query as above  
Let say I want to get the absolute path of all the file found using ls

How to do that ??

---

<div class="post-metadata">

**Author:** ![ctsgnb](https://community.unix.com/letter_avatar/ctsgnb/32/6_449c533f586939b6e5f246632a46421f.png) [@ctsgnb](https://community.unix.com/u/ctsgnb)\
**Post date:** [February 17, 2011, 8:38am UTC](https://community.unix.com/t/command-not-found-errors-when-running-csh-script/282984/4 "2011-02-17T08:38:31Z")

</div>

Not sure about what you are willing to get ... maybe something like :

```nohighlight
find $PWD -type f -prune

```

?
