On Fri, Feb 19, 2016 at 12:45 AM, Greg Wooledge wrote:
> On Thu, Feb 18, 2016 at 05:58:28PM +0100, baldu...@units.it wrote:
> > > On Thu, Feb 18, 2016 at 11:06:37PM +0700, Robert Parker wrote:
> > > > The script:
> > > > #/bin/bash
> > ^ missing !
On Thu, Feb 18, 2016 at 11:30 PM, Greg Wooledge wrote:
> On Thu, Feb 18, 2016 at 11:06:37PM +0700, Robert Parker wrote:
> > The script:
> > #/bin/bash
> > # testlink.sh
> > # must be run as root
> >
> > file1="$1"
> > shift
> > mandi
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
r variable default value: 0
Begining with an assignment operator, enter C code for this option:
= 1
So getans() is the origin of the problem.
I have spent quite some time rewriting that and in the above it is the
cleanest version I've written but it has clearly caused problems down the
track.
On Tue, Sep 1, 2015 at 12:34 AM, John McKown
wrote:
> Not a bug, so likely the wrong forum.
>
> Have you tried doing a fflush() after the fputs()? I.e. something to tell
> the Kernel to "write this out immediately!". In the case of write(), I
> think you need to use the O_SYNC flag in the open()
A trivial script example that just works:
#!/bin/bash
# echo a prompt and write the user's response to a file.
echo "Enter variable name: "
read ans
echo "$ans" > tmpfil
echo "Enter variable type: "
read ans
echo "$ans" >> tmpfil
echo "Enter variable default value: "
read ans
echo "$ans" >> tmpfi