[Gambas-user] Linux files question and very of gambas topic

Benoit Minisini gambas at ...1...
Sat Mar 13 16:04:02 CET 2004


On Saturday 13 March 2004 15:57, ron wrote:
> On Saturday 13 March 2004 10:02, Laurent Godard wrote:
> > Hi ron,
> >
> > > I need to append several binairy files together but can't find a simple
> > > CLI command to do that.
> >
> > did you try, under shell
> >
> > cat file1 file2 file3 > targetfile
> >
> > inside gambas, i would try
> > open a target for append as binary (or equivalent)
> > loop over source files
> > open as read binary
> > read
> > write target
> >
> > HTH
> >
> > laurent
>
> I new it could be simple, You have only to know how.
>
> Well the cat file1 file2 file3 > target did it in the test.
> I did not see extra or missing bytes at the point the files where append.
>
> The gambas way is nice but it should run as a cron task and then the cat
> way is more easy.
>
> Ok so I can  write a script ????
>
> copy a working script as example with same functionality
> addfiles.sh with permission all set rwxrwxrwx
>
> #! /bin/sh
> # in the above line do I need the space or not ?????????
> cd /data/ham/amsat/received
> myfiles=$(ls *.bin)
>
> for myfile in $myfiles; do
>  cat /data/ham/amsat/received/$myfile > /data/ham/amsat/screen/rpack.bin
>  #rm /data/ham/amsat/received/$myfile
> done
> cd -
>
> The result is
> bash: ./append.sh: /bin/sh: bad interpreter: Permission denied
>
>  I'm feeling so stupid ;(
>
> Thanks Ron.
>

Did you try #!/bin/sh without a space ?

Otherwise, you can use a gambas executable in your crontab. After all, gambas 
executable are exactly shell scripts, except that you have #!/bin/gbx in the 
beginning of the file instead of #!/bin/sh.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list