[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CL function to script difficulties
From: |
G. Branden Robinson |
Subject: |
Re: CL function to script difficulties |
Date: |
Fri, 19 Apr 2024 15:19:11 -0500 |
At 2024-04-19T15:15:07-0500, Mike McClain wrote:
> This function defined on the command line works as I wish:
> dircmp() {
> diff <(cd $1; find . -type f,l,d -printf '%p %s %t\n' | sort) \
> <(cd $2; find . -type f,l,d -printf '%p %s %t\n' | sort);
> }
> When I put the same into a script I get this error:
> dircmp: 12: Syntax error: "(" unexpected
>
> Hopefully one of you gurus can explain this.
Make sure your script's shebang line is
#!/bin/bash
or maybe
#!/bin/sh
You're using a non-POSIX shell feature, process substitutions.
Regards,
Branden
signature.asc
Description: PGP signature