Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

A shell script for dict to display its output with less.

Here you can discuss every aspect of Debian. Note: not for support requests!
Post Reply
Message
Author
User avatar
edbarx
Posts: 5401
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E
Been thanked: 2 times

A shell script for dict to display its output with less.

#1 Post by edbarx »

This is a simple bash script for dict to display its output with less. If you want to use the script copy it to file under /bin or under /home if you prefer. Don't forget to make the script executable.

The shell script checks the number of parameters passed to it. If the number of parameters is one,

Code: Select all

dict search_word | less
is executed. If not, the script issues an error depending on the number of parameters passed.

Code: Select all

#!/bin/bash

if (($# == 1));
	then dict $1 | less
	else 	  
		if (($# > 1)); then
			echo "Only one word is allowed."
			exit 0
		fi
		echo "You must type a word to search."
fi

exit 0
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.

Post Reply