Logscan is a small command‑line utility in this repository.
src/logscan.c— primary C source required by the build script.src/logscan_noncurses.c— fallback non‑ncurses source; the installer writes this file if ncurses is not available.man/logscan.1— optional man page (installed only if present).install.sh— build and install script with modes:install,build-only,uninstall,help.Makefile— optional helper (if present).
-
Modes supported
install— ensure build tools, attempt to build, then install binary and man page.build-only— compile the binary in the current directory only (no system install).uninstall— remove installed binary and man page.help— print usage and exit.
-
Build logic
- The script requires
src/logscan.c. If that file is missing the script exits with an error. - It checks for
gcc. Ifgccis missing the script attempts to install build tools using the detected package manager (apt,dnf,yum,pacman,apk,brew) where available. If no package manager is detected it prints instructions to install build tools manually. - It tests whether ncurses development headers and library are usable by compiling a tiny test program linked with
-lncurses.- If the test succeeds, the script compiles
src/logscan.cwith-lncurses. - If the test fails, the script attempts to install ncurses dev packages via the detected package manager.
- If ncurses still cannot be used, the script writes a small fallback source file
src/logscan_noncurses.c(a minimal ANSI fallback) and compiles that instead.
- If the test succeeds, the script compiles
- On success the script produces a local binary named
logscanin the current directory.
- The script requires
-
Install logic
installmode installs the binary to/usr/local/bin/logscan(mode0755).- If
man/logscan.1exists, it installs it to/usr/local/share/man/man1/logscan.1(mode0644). - If
mandbis available the script runsmandb(errors ignored). sudois required for the install steps that write to system locations.
-
Uninstall logic
- Removes
/usr/local/bin/logscanand/usr/local/share/man/man1/logscan.1(if present) and runsmandbif available.
- Removes
Run these commands from the repository root.
Clone and prepare
git clone https://github.com/nnotych/LinuxLogScanTool.git
cd LinuxLogScanTool
chmod +x install.shBuild only (no install)
./install.sh build-only
# On success a local ./logscan binary will be createdInstall system‑wide
sudo ./install.sh install
# Installs /usr/local/bin/logscan and, if present, /usr/local/share/man/man1/logscan.1Uninstall
sudo ./install.sh uninstallAlternative (Makefile)
make
# If Makefile is present and configured, it may produce the binary without using install.sh- Binary:
/usr/local/bin/logscan - Man page (if present):
/usr/local/share/man/man1/logscan.1
- Run the built binary in the current directory
./logscan --help- Run the installed binary
logscan --help
# or
/usr/local/bin/logscan --help- Check man page
man logscan- Verify installed files
ls -l /usr/local/bin/logscan
ls -l /usr/local/share/man/man1/logscan.1Note: The installer script does not itself document runtime CLI flags. Use
logscan --helporman logscan(if installed) to see the exact runtime options provided by the compiled binary.
-
Source file src/logscan.c not found- Ensure
src/logscan.cexists in the repository root. The installer requires this file.
- Ensure
-
gcc not found- Install build tools manually. Example for Debian/Ubuntu:
sudo apt-get update sudo apt-get install -y build-essential
- Install build tools manually. Example for Debian/Ubuntu:
-
ncurses test fails and fallback is used
- To get the ncurses build (interactive mode), install the dev package for your distro:
- Debian/Ubuntu:
sudo apt-get install -y libncurses5-dev libncursesw5-dev
- Fedora/CentOS:
sudo dnf install -y ncurses-devel
- Debian/Ubuntu:
- If you cannot install ncurses, the script will compile
src/logscan_noncurses.cautomatically and produce a fallback binary.
- To get the ncurses build (interactive mode), install the dev package for your distro:
-
Permission denied during install
- Use
sudo ./install.sh install.
- Use
-
Man page not installed
- The script installs the man page only if
man/logscan.1exists in the repository. Add or update that file if you need a man page installed.
- The script installs the man page only if
-
mandbnot available or errors updating man database- The script ignores
mandberrors; man pages still install to the target directory.
- The script ignores
src/logscan.cis present.- You have
sudoaccess forinstallmode. gccand basic build tools are installed or available to be installed.- If you need interactive ncurses support, ensure ncurses dev packages are available on the system.
- Add a
LICENSEfile to the repository root if you want to declare a license (for example, MIT). - Contribution workflow: fork → branch → commit → pull request. Document any new runtime flags in
--helpandman/logscan.1.
If you want this exact content written to a README.md file in the repository, I can produce the file contents for you to paste into README.md.

