I than mixed the codes I found on these sites together to make something below:
I am by no means an expert Bash scripter however, once I started looking at the code I was able to roughly figure out how this worked. Obviously this code be improved upon but this serves my purpose for now.
in csh I was using:
set prompt=""$HOSTNAME".tk.\!> "
to customize the look of my prompt. I have seen the light after reading the perils of csh scripting and wish to switch to bash. How do I customize my bash prompt??? I've tried many variation of the above w/no success, and searching this... (2 Replies)
hi experts,
i just need a help that my script is generating the output which i will mentioned below but the fileds are not justified the alignment is disturbed.
0 8718 8718 0 8777
1 7450 7450 0 7483
2 5063 5063 0 5091
3 3840 3840 0 3855
4 ... (2 Replies)
I'm trying to use unison from bash on windows with cygwin. I don't know if this is a cygwin question, bash question or unison question. Since I always get reprimanded by the cygwin mailing list for assuming it is a cygwin problem, I'll assume it is a bash question.
The following commands work... (7 Replies)
It looks like,
user@hostname:/auto/home3/user$
Desired,
user@hostname$
I added following line in .bashrc, but still its same.
export PS1=" $ "
Please help me :confused: (13 Replies)
Hi,
Does anyone know any way of making bash prompt extended with conditional content?
Example:
export PS1="] && echo '#' || echo '\$'" # This won't work - prompt is not executed
# export PS1="\$" # This is an existing but also working equivalent
I would like to use more complex... (8 Replies)
I'm using a custom prompt with PS1 in my .profile. It is
PS1="\\u@\e\:\W\ \\$\ \"
and it works well, as you can see,
http://content.screencast.com/users/killer54291/folders/Jing/media/2b3db52a-ebf7-43e2-95cc-f45dadbc2b98/00000023.png
but, when i type more than the width of the window, it... (0 Replies)
This is an instance of "if it's not one thing, it's another."
I recently fell victim to my own stupidity in trashing, by accident, my long-running and very highly-customized .bash_profile and .bashrc files for Cygwin & Cygwin/X. I had backups from a previous "go" with this, and decided to use... (0 Replies)
I am working with a script to simplyfy some operations where I work, but one of the programs needs me to enter a password.
It will as me "Please enter the administrator password:"
Is there a way to make a bash script to automatically answer the question with the needed password?
I am looking... (3 Replies)
Hi,
I'm trying to run a program from the bash prompt and I don't understand why it is returning with an error.
Dig is my C program, and it takes in parameters J4, detect, 3 and 0182F98E
var1="cygdrive/c/2i/test fixture/software/mccdaqtest/debug/Dig J4 detect 3 0182F98E"
when I do
... (6 Replies)
Hello Guys,
I have facing problem with linux shell prompt .Am expecting my Bash prompt to be like below
but its showing like
~]$ ot@Servername and while typing the commands the prompt looks like below:
~]$ echo $PS1
$
~]$ ot@ServernameChecked the .bash_profile and also changed... (9 Replies)
Discussion started by: kapil514
9 Replies
LEARN ABOUT DEBIAN
imager::fountain
Imager::Fountain(3pm) User Contributed Perl Documentation Imager::Fountain(3pm)NAME
Imager::Fountain - a class for building fountain fills suitable for use by
the fountain filter.
SYNOPSIS
use Imager::Fountain;
my $f1 = Imager::Fountain->read(gimp=>$filename);
$f->write(gimp=>$filename);
my $f1 = Imager::Fountain->new;
$f1->add(start=>0, middle=>0.5, end=>1.0,
c0=>Imager::Color->new(...),
c1=>Imager::Color->new(...),
type=>$trans_type, color=>$color_trans_type);
DESCRIPTION
Provide an interface to build arrays suitable for use by the Imager fountain filter. These can be loaded from or saved to a GIMP gradient
file or you can build them from scratch.
read(gimp=>$filename)
read(gimp=>$filename, name=>$name)
Loads a gradient from the given GIMP gradient file, and returns a new Imager::Fountain object.
If the name parameter is supplied as a scalar reference then any name field from newer GIMP gradient files will be returned in it.
my $gradient = Imager::Fountain->read(gimp=>'foo.ggr');
my $name;
my $gradient2 = Imager::Fountain->read(gimp=>'bar.ggr', name=>$name);
write(gimp=>$filename)
write(gimp=>$filename, name=>$name)
Save the gradient to a GIMP gradient file.
The second variant allows the gradient name to be set (for newer versions of the GIMP).
$gradient->write(gimp=>'foo.ggr')
or die Imager->errstr;
$gradient->write(gimp=>'bar.ggr', name=>'the bar gradient')
or die Imager->errstr;
new Create an empty fountain fill description.
add(start=>$start, middle=>$middle, end=>1.0, c0=>$start_color, c1=>$end_color, type=>$trans_type, color=>$color_trans_type)
Adds a new segment to the fountain fill, the possible options are:
o "start" - the start position in the gradient where this segment takes effect between 0 and 1. Default: 0.
o "middle" - the mid-point of the transition between the 2 colors, between 0 and 1. Default: average of "start" and "end".
o "end" - the end of the gradient, from 0 to 1. Default: 1.
o "c0" - the color of the fountain fill where the fill parameter is equal to start. Default: opaque black.
o "c1" - the color of the fountain fill where the fill parameter is equal to end. Default: opaque black.
o "type" - the type of segment, controls the way in which the fill parameter moves from 0 to 1. Default: linear.
This can take any of the following values:
o "linear"
o "curved" - unimplemented so far.
o "sine"
o "sphereup"
o "spheredown"
o "color" - the way in which the color transitions between "c0" and "c1". Default: direct.
This can take any of the following values:
o "direct" - each channel is simple scaled between c0 and c1.
o "hueup" - the color is converted to a HSV value and the scaling is done such that the hue increases as the fill parameter
increases.
o "huedown" - the color is converted to a HSV value and the scaling is done such that the hue decreases as the fill parameter
increases.
In most cases you can ignore some of the arguments, eg.
# assuming $f is a new Imager::Fountain in each case here
use Imager ':handy';
# simple transition from red to blue
$f->add(c0=>NC('#FF0000'), c1=>NC('#0000FF'));
# simple 2 stages from red to green to blue
$f->add(end=>0.5, c0=>NC('#FF0000'), c1=>NC('#00FF00'))
$f->add(start=>0.5, c0=>NC('#00FF00'), c1=>NC('#0000FF'));
simple(positions=>[ ... ], colors=>[...])
Creates a simple fountain fill object consisting of linear segments.
The array references passed as positions and colors must have the same number of elements. They must have at least 2 elements each.
colors must contain Imager::Color or Imager::Color::Float objects.
eg.
my $f = Imager::Fountain->simple(positions=>[0, 0.2, 1.0],
colors=>[ NC(255,0,0), NC(0,255,0),
NC(0,0,255) ]);
Implementation Functions
Documented for internal use.
_load_gimp_gradient($class, $fh, $name)
Does the work of loading a GIMP gradient file.
_save_gimp_gradient($self, $fh, $name)
Does the work of saving to a GIMP gradient file.
FILL PARAMETER
The add() documentation mentions a fill parameter in a few places, this is as good a place as any to discuss it.
The process of deciding the color produced by the gradient works through the following steps:
1. calculate the base value, which is typically a distance or an angle of some sort. This can be positive or occasionally negative,
depending on the type of fill being performed (linear, radial, etc).
2. clamp or convert the base value to the range 0 through 1, how this is done depends on the repeat parameter. I'm calling this result
the fill parameter.
3. the appropriate segment is found. This is currently done with a linear search, and the first matching segment is used. If there is no
matching segment the pixel is not touched.
4. the fill parameter is scaled from 0 to 1 depending on the segment type.
5. the color produced, depending on the segment color type.
AUTHOR
Tony Cook <tony@develop-help.com>
SEE ALSO Imager(3)perl v5.14.2 2011-06-06 Imager::Fountain(3pm)