useful scripts



I've been trying to use terminals less often so I made myself these
useful scripts to do a 'make all', 'make clean' or 'make install' in the
current directory or the selected directories. I've attached them for
anyone who is interested.

Also, trying to use these scripts made me realize how much the Scripts
submenu sucks. ;)

Nautilus really needs a scripts sidebar or toolbar for easy access.
Maybe I will try and make one.

Cheers,

- Frank


#!/bin/bash
# From Frank Worsley
# Runs make all in the current directory or all selected directories.

COMMAND="
	KEY=\"A\";
	while [ \"\$KEY\" == \"A\" ]; do
		make all;
		echo ' ';
		echo 'Press ENTER to close this terminal.';
		echo 'Press A + ENTER to run this command again.';
		read KEY;
		clear;
	done"

if [ "$*" ]; then
	# make all in the selected directories
	for DIR in $*; do
		gnome-terminal --working-directory `pwd`/$DIR -t "Making all in `pwd`/$DIR" -x bash -c "$COMMAND" &
	done
else
	# just do make all in the current directory
	gnome-terminal --working-directory `pwd` -t "Making all in `pwd`" -x bash -c "$COMMAND"
fi
#!/bin/bash
# From Frank Worsley
# Runs make clean in the current directory or all selected directories.

if [ "$*" ]; then
	# make all in the selected directories
	for DIR in $*; do
		make -C $DIR clean
	done
else
	# just do make all in the current directory
	make clean
fi
#!/bin/bash
# From Frank Worsley
# Runs make install in the current directory or all selected directories.

COMMAND="
	KEY=\"A\";
	while [ \"\$KEY\" == \"A\" ]; do
		make install;
		echo ' ';
		echo 'Press ENTER to close this terminal.';
		echo 'Press A + ENTER to run this command again.';
		read KEY;
		clear;
	done"

if [ "$*" ]; then
	# make install in the selected directories
	for DIR in $*; do
		gnome-terminal --working-directory `pwd`/$DIR -t "Making install in `pwd`/$DIR" -x bash -c "$COMMAND" &
	done
else
	# just do make install in the current directory
		gnome-terminal --working-directory `pwd` -t "Making install in `pwd`" -x bash -c "$COMMAND"
fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]