10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have the basic command written in bash
for element in 1 2
do
if ]; then
set el = "t"
else
set el = "p"
fi
done
but i get the following error
syntax error near unexpected token `for'
` for element in 1 2'
What should i do differently? (3 Replies)
Discussion started by: ncwxpanther
3 Replies
2. Shell Programming and Scripting
Hello.
I am running 2 scripts : script_1 and script_2
These scripts are run as root
Script 2 contains :
#!/bin/bash
#
# ~/bin/script_2
#
E_BAD_PARAM=115
#
date2stamp () {
date --date "$1" +%Y-%m-%d___%H:%M:%S
}
#
USER_NAME=$1
NB_PARAM=$#
PARAM0=$0 (2 Replies)
Discussion started by: jcdole
2 Replies
3. Shell Programming and Scripting
Below is a simple script to prompt for user input while suggesting an editable default value at the prompt:
shortname=user1
read -e -i $shortname -p "Please enter the username you would like to add: " input
USERNAME="${input:-$shortname}"
Please enter the username you would like to add:... (3 Replies)
Discussion started by: woodson2
3 Replies
4. Shell Programming and Scripting
hi all,
i have a script that need user input provide all variables that needed to complete a job.
this is my current script:
echo "type file source and it full path :"
read INPUTFILE
if || ;
then
echo "ERROR: you didn't enter a file source or file source is not... (2 Replies)
Discussion started by: makan
2 Replies
5. Shell Programming and Scripting
I am starting to learn how to use bash and I would like the script to do the following:
Asks the user for his/her name
Asks the user for one number
Asks the user for another number
Then it adds the two numbers,
Also multiply the two numbers
I have the part where you get the name, and I... (3 Replies)
Discussion started by: boyboy1212
3 Replies
6. Shell Programming and Scripting
Hi all, I currently have a script which uses read -p for user interaction. e.g.
read -p "New user? " user
Is it possible to have it so if the user enters nothing and just presses return it can resort to a specified value instead?
Thanks! :) (5 Replies)
Discussion started by: JayC89
5 Replies
7. UNIX for Dummies Questions & Answers
Hey, im trying to validate a user input and need some help. The input needs to be just a single letter. Im using a case to so this eg:
read answer
case $answer in
*) echo "OK"
;;
*) echo "This is a number"
read answer
;;
*) echo... (2 Replies)
Discussion started by: 602chrislys
2 Replies
8. Shell Programming and Scripting
I'm working on making a menu system on an HP-UX box with Bash on it. The old menu system presents the users with a standard text menu with numbers to make selections. I'm re-working the system and I would like to provide something more akin to iterative search in Emacs.
I have a list of 28... (2 Replies)
Discussion started by: deckard
2 Replies
9. Shell Programming and Scripting
Bash : how do i check the user input and make sure is only character or only number ? (7 Replies)
Discussion started by: CheeSen
7 Replies
10. Shell Programming and Scripting
Hi,
I have a program that searches for a particular string patten. I am however having difficulty passing the varible $i (in a loop) as the string pattern to replace. Using either perl or sed search and replace statements, I get the same kinda result. For example, using the perl:
for i in... (3 Replies)
Discussion started by: Breen
3 Replies
ppmtosixel(1) General Commands Manual ppmtosixel(1)
NAME
ppmtosixel - convert a portable pixmap into DEC sixel format
SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile]
DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC
LJ250 color inkjet printer.
If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table
begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file.
OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com-
pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni-
tude larger than a compressed file and prints much slower.
-margin
If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci-
fied, a 1.5 inch left margin will offset the image.
PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?.
BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was
greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the
color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation.
SEE ALSO
ppm(5)
AUTHOR
Copyright (C) 1991 by Rick Vinci.
26 April 1991 ppmtosixel(1)