xfilesel 

Usage 

usage:  xfilesel [-f name] [-selection name]
   -file name - path of clipboard file (default value: ~/.clipboard),
        for example: -f /dev/tty1, -f /home/mc/.cedit/cooledit.clip
   -selection name - name of the selection to use. The default is PRIMARY.

Info 

The xfilesel program is used to copy the X selection into a file and to copy a file contents to the X selection. It acts as a bridge between applications that support selections and console applications (for example with default Midnight Commander clipboard file ~/.cedit/cooledit.clip).

Source 

http://freshmeat.net/projects/xfilesel http://freshmeat.net/projects/xfilesel/download/xfilesel.tar.gz

http://www.opennet.ru/xfilesel/

Installation 

The installation procedure is

1) xmkmf
2) make
3) make install

On linux 

$ xmkmf
mv -f Makefile Makefile.bak
imake -DUseInstalled -I/usr/X11R6/lib/X11/config
$ make
gcc -O2 -g -Wall     -I/usr/X11R6/include   -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE=500L -D_BSD_SOURCE -D_SVID_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO     -c -o xfilesel.o xfilesel.c
xfilesel.c:3: warning: `/*' within comment
xfilesel.c:5: warning: `/*' within comment
xfilesel.c:93: warning: return-type defaults to `int'
xfilesel.c:275: warning: return type of `main' is not `int'
rm -f xfilesel
gcc -o xfilesel -O2 -g -Wall      -L/usr/X11R6/lib xfilesel.o -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11
$ make -n install
make: *** Warning: File `xfilesel' has modification time in the future (2000-09-03 16:15:13 > 2000-09-03 16:07:45)
if [ -d /usr/X11R6/bin ]; then set +x; \
else (set -x; mkdir -p /usr/X11R6/bin); fi
install -c -s  xfilesel /usr/X11R6/bin/xfilesel
echo "install in . done"

Configuration & Twisting 

On Solaris

$ xmkmf
imake -DUseInstalled -I/opt/gnu/lib/X11/config
"Imakefile.c", line 10: Can't find include file Imake.tmpl
imake: Exit code 2.
  Stop.

manually invoke:

imake -DUseInstalled -I/shared/openwin/lib/X11/config/
$ make
cc -O -Xc -xF -xcg92    -I/usr/openwin/include  -Dsun -Dsparc -DSVR4 -DSYSV    XkbClientDefines   -c xfilesel.c -o xfilesel.o
/usr/ucb/cc:  language optional software package not installed

Comments 

It's a GUI based program. need to click on the buttons.