|
General software and network General OS-independent software and network questions, X11, MTA, routing, etc. |
|
Thread Tools | Display Modes |
|
|||
a ./configure script doesn't found 'locate'
I download Sparforte, a shell that permit writing script in somewhat a subset of Ada,
the strong statically typed language. I tried the version compiled for Freebsd. I guess there is a way to emulate it or run it directly, but I don't know yet. Then I tried to compile the sources. It said that it can't find 'glocate' or 'locate', despite it being here. A clue ? Can I settle this by setting some variables to the exported environment ? Sources : http://sparforte.com/downloads/sparf....5-src.tar.bz2 FreeBSD binary : http://sparforte.com/downloads/sparf...ebsd10.tar.bz2 |
|
|||
the script is pretty simple, it does only seek for 'locate' or 'glocate'
Sorry but I don't know that much sh scripting, and when I type : $ if [$? -ne 0]; then echo "non" else echo "yes" fi it shows "bigger than" symbol, waiting other entries. Sorry to ask such a thing, but what's the good syntax to enter the test manually ? sh scripting is just so ugly, that's why I want to use Sparforte. |
|
||||
The $? environment variable contains the return code of the last executed command.
Test 1: Start with manually issuing a glocate command: $ glocate --help There are several possible outcomes. If you get this: Code:
sh: glocate: not found If you get any other output, then glocate has executed, and you need Test 2: $ echo $? The value echoed will be the return code from glocate. Quote:
|
|
|||
Ok, but, hey , I wasn't complaining, just saying why I want it, to learn and labour less hereafter .
First, 'locate --help', send 127 as a status message, I don't know how it is interpreted, but I change the first ' $LOCATE --help ' into ' locate /usr/. > /dev/null 2>&1 ' Manualy, consequently $? become 1 I can't run it manualy, but [ $? -ne 0] should meant "only zero". Without change, the result was 127, and now the test become [ 1 -ne 0 ] but it still echoes "no". Need the return code be 0 for the test being false ? |
|
||||
In the Bourne shell, a 127 return code means "command not found".
Code:
$ glocate --help Usage: glocate [-d path | --database=path] [-e | -E | --[non-]existing] [-i | --ignore-case] [-w | --wholename] [-b | --basename] [--limit=N | -l N] [-S | --statistics] [-0 | --null] [-c | --count] [-P | -H | --nofollow] [-L | --follow] [-m | --mmap] [-s | --stdio] [-A | --all] [-p | --print] [-r | --regex] [--regextype=TYPE] [--max-database-age D] [--version] [--help] pattern... Report bugs to <bug-findutils@gnu.org>. $ echo $? 0 $ Code:
$ glocate --version locate (GNU findutils) 4.5.11 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Eric B. Decker, James Youngman, and Kevin Dalley. $ |
Tags |
netbsd/freebsd compatibility |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
X -configure | ocicat | OpenBSD General | 3 | 19th July 2012 04:30 AM |
need help to configure netstick. | wlm2 | OpenBSD General | 5 | 30th September 2011 01:27 PM |
configure command not found | Stellar | FreeBSD Installation and Upgrading | 4 | 3rd October 2010 07:01 AM |
Ath0 + wpa, how configure? | nesca2in1 | FreeBSD General | 10 | 2nd July 2008 04:12 AM |
Can't locate themes now | anomie | Feedback and Suggestions | 10 | 5th May 2008 12:57 AM |