On Thu, Sep 19, 2019 at 10:20 AM Rowan Worth wrote:
> On Thu, 19 Sep 2019 at 16:03, Dominique Devienne
> > On Wed, Sep 18, 2019 at 6:43 PM Clemens Ladisch
> > > Peng Yu wrote:
> > > > Is there a better way to just return an exit status of 0 for
> > > > a sqlite3 DB file and 1 otherwise?
>
> > >
On Thu, 19 Sep 2019 at 16:03, Dominique Devienne
wrote:
> On Wed, Sep 18, 2019 at 6:43 PM Clemens Ladisch
> wrote:
>
> > Peng Yu wrote:
> > > Is there a better way to just return an exit status of 0 for
> > > a sqlite3 DB file and 1 otherwise?
> >
> > Extract the magic header string from a known
On Wed, Sep 18, 2019 at 6:43 PM Clemens Ladisch wrote:
> Peng Yu wrote:
> > Is there a better way to just return an exit status of 0 for
> > a sqlite3 DB file and 1 otherwise?
>
> Extract the magic header string from a known DB file:
>
> dd bs=16 count=1 < some.db > sqlite3-signature
>
> Then y
Peng Yu wrote:
> Is there a better way to just return an exit status of 0 for
> a sqlite3 DB file and 1 otherwise?
Extract the magic header string from a known DB file:
dd bs=16 count=1 < some.db > sqlite3-signature
Then you can compare it against the beginning of the file:
cmp --bytes=16 s
Hi,
I use `file` to check if a file is a sqlite3 DB file. But I have to
parse the result. Is there a better way to just return an exit status
of 0 for a sqlite3 DB file and 1 otherwise? Thanks.
$ file /tmp/tmp.erZ5aS6PUX.sqa
/tmp/tmp.erZ5aS6PUX.sqa: SQLite 3.x database, last written using
SQLite
5 matches
Mail list logo