bug-bash
[Top][All Lists]
Advanced

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

Problem with small script


From: Robert Parker
Subject: Problem with small script
Date: Thu, 18 Feb 2016 23:06:37 +0700

The script:
#/bin/bash
# testlink.sh
# must be run as root

file1="$1"
shift
mandir=/usr/local/share/man/man3/
cp "$file1" "$mandir"
cd "$mandir"
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
>>

Bash version: 4.3.11(1)-release (x86_64-pc-linux-gnu)

Any help appreciated,
Thanks.

--
The Bundys, Cliven, Ted and Al. Great guys to look up to.

reply via email to

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