lsx-0.1/0000755000014400001440000000000010513655035010647 5ustar arguserslsx-0.1/Makefile0000644000014400001440000000177310513655035012317 0ustar argusers# lsx - list executables # (C)opyright MMVI Anselm R. Garbe include config.mk SRC = lsx.c OBJ = ${SRC:.c=.o} all: options lsx @echo finished options: @echo lsx build options: @echo "CFLAGS = ${CFLAGS}" @echo "LDFLAGS = ${LDFLAGS}" @echo "CC = ${CC}" .c.o: @echo CC $< @${CC} -c ${CFLAGS} $< lsx: ${OBJ} @echo LD $@ @${CC} -o $@ ${OBJ} ${LDFLAGS} @strip $@ clean: @echo cleaning @rm -f lsx ${OBJ} lsx-${VERSION}.tar.gz dist: clean @echo creating dist tarball @mkdir -p lsx-${VERSION} @cp -R LICENSE Makefile README config.mk ${SRC} lsx-${VERSION} @tar -cf lsx-${VERSION}.tar lsx-${VERSION} @gzip lsx-${VERSION}.tar @rm -rf lsx-${VERSION} install: all @echo installing executable file to ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin @cp -f lsx ${DESTDIR}${PREFIX}/bin @chmod 755 ${DESTDIR}${PREFIX}/bin/lsx uninstall: @echo removing executable file from ${DESTDIR}${PREFIX}/bin @rm -f ${DESTDIR}${PREFIX}/bin/lsx .PHONY: all options clean dist install uninstall lsx-0.1/LICENSE0000644000014400001440000000225010513655035011653 0ustar argusersMIT/X Consortium License (C)opyright MMVI Anselm R. Garbe (C)opyright MMVI Sander van Dijk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lsx-0.1/lsx.c0000644000014400001440000000136010513655035011621 0ustar argusers/* (C)opyright MMVI Anselm R. Garbe * See LICENSE file for license details. */ #include #include #include #include #include #include int main(int argc, char *argv[]) { int i; struct dirent *dp; struct stat s; DIR *dir; if((argc > 1) && !strncmp(argv[1], "-v", 3)) { fputs("lsx-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout); exit(EXIT_SUCCESS); } for(i = 0; i < argc; i++) if((dir = opendir(argv[i]))) { fchdir(dirfd(dir)); do if((dp = readdir(dir)) && (stat(dp->d_name, &s) != -1) && S_ISREG (s.st_mode) && !access(dp->d_name, X_OK)) puts(dp->d_name); while(dp); closedir(dir); } return 0; } lsx-0.1/README0000644000014400001440000000070310513655035011527 0ustar arguserslsx - list executables ====================== Prints all executable file names of given absolute paths to standard output. Installation ------------ Edit config.mk to match your local setup (lsx is installed into the /usr/local namespace by default). Afterwards enter the following command to build and install lsx (if necessary as root): make clean install Running lsx ----------- Simply invoke the 'lsx' with arbitrary paths as arguments. lsx-0.1/config.mk0000644000014400001440000000054710513655035012453 0ustar argusers# lsx version VERSION = 0.1 # Customize below to fit your system # paths PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man # includes and libs INCS = -I/usr/lib LIBS = -L/usr/lib -lc # flags CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" LDFLAGS = ${LIBS} #CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\" #LDFLAGS = -g ${LIBS} # compiler CC = cc