bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with small script


From: balducci
Subject: Re: Problem with small script
Date: Thu, 18 Feb 2016 17:58:28 +0100

> On Thu, Feb 18, 2016 at 11:06:37PM +0700, Robert Parker wrote:
> > The script:
> > #/bin/bash
     ^ missing ! here

typo in the shebang?

> > # testlink.sh
> > # must be run as root
> > 
> > file1="$1"
> > shift
> > mandir=/usr/local/share/man/man3/
> > cp "$file1" "$mandir"
> > cd "$mandir"
> 
> You MUST check the result of cd.  If it fails but you continue on,
> you will be operating in the wrong place.
> 
> > echo '$hash = '"$#"
> > while (( "$#" )); do
> >     file2="$1"
> >     ln "$file1" "$file2"
> >     shift
> > done
> > 
> > Results:
> > >> sudo ./testlink.sh readfile.3 readtextfile.3
> > $hash = 1
> > ./testlink.sh: 11: ./testlink.sh: 1: not found
> > >>
> 
> As near as I can tell, you are somehow running this script under sh
> instead of bash.

ciao
gabriele



reply via email to

[Prev in Thread] Current Thread [Next in Thread]