Sponsored Content
Full Discussion: Using color in scripts
Operating Systems Linux Ubuntu Using color in scripts Post 303033773 by wisecracker on Thursday 11th of April 2019 01:34:29 PM
Old 04-11-2019
Some of these terminal escape codes even 'tput' can't do.
All work on CygWin's 'mintty' terminal too.
Code:
#!/bin/sh

# For those that do not have tput.
# Some of these cannot even be done using tput!
# All work on the majority of terminals but some terminals can't do them all.

# Resize the terminal on the fly, even works on CygWin's mintty, this resizes to 30 rows by 86 columns.
echo "Resize terminal to 30 x 86."
printf "%b" "\033[8;30;86t"
sleep 2
# And resize to a standard size of 24 rows by 80 columns.
echo "Resize terminal to 24 x 80."
printf "%b" "\033[8;24;80t"

# Reset terminal for machines that do not have it.
echo "Reset the terminal."
sleep 2
printf "%b" "\033c\033[0m\033[2J\033[H"

# Clear the screen.
echo "Clear the screen."
sleep 1
printf "%b" "\033[2J\033[H"
echo "Alternate clear screen."
sleep 1
# OR...
printf "%b" "\033[2J\033[1;1f"

# Clear the terminal current buffer only.
printf "%b" "\033[3J"

# Write into the terminal title bar.
printf "%b" "\033]0;Barry Walker.\007"
sleep 2
# And clear it again.
printf "%b" "\033]0;\007"

Enjoy lads and lassies...

Last edited by wisecracker; 04-11-2019 at 02:45 PM..
This User Gave Thanks to wisecracker For This Post:
 

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to change the background color in the init 3 mode(not line color)

Hello, I am using RHEL 6.1 on VMware I am searching for a way to change background color (not line by line color wich one can using tput command) basically changing the color of the whole screen to white instead of the default black and changing font color to black and alos would like to... (2 Replies)
Discussion started by: Dexobox
2 Replies

2. UNIX for Beginners Questions & Answers

Text color in Linux scripts via putty

hi Folks, Can anyone help with changing the color of the words in a linux shell script? I get how to change default background etc in putty, but for some reason the text in the script has different colors for different parts of the cript. Is there a way to have one color in a linux shell... (5 Replies)
Discussion started by: jonnyd
5 Replies
INSTALLSIEVE(1) 					      General Commands Manual						   INSTALLSIEVE(1)

 *

NAME
installsieve - user utility for managing sieve scripts SYNOPSIS
installsieve DESCRIPTION
installsieve is a utility that allows users to manage their sieve scripts kept on the server. OPTIONS
-v <name> View script with the given name. The script if retrieved sucessfully is output to standard output. -l List all of the scripts currently on the server. If one of the scripts is active a arrow is printed indicating that it is the active script. -p <port> Port to connect to. If left off this defaults to "sieve" as defined in /etc/services. -i <file> Install a file onto the server. If a script with the same name already exists on the server it is overwritten. Upon sucessfully putting the script on the server the script is set active. If <file> has the extension .script it is chopped when put on the server since sieve names may not contain a '.'. -a <name> Set <name> as the active script. The list of available names can be obtained from the '-l' option.. -d <name> Delete the sieve script on the server with <name>. -m <mechanism> Force installsieve to use <mechanism> for authentication. If not specified the strongest authentication mechanism is chosen. -g <name> Get the sieve script with <name> and save it to disk with a ".script" extension. If a file with that name already exists it is overwritten. -u <user> Userid/Authname to use for authentication; by default, the current user. CMU
Project Cyrus INSTALLSIEVE(1)
All times are GMT -4. The time now is 02:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy