Sponsored Content
Full Discussion: What does -f do
Top Forums UNIX for Dummies Questions & Answers What does -f do Post 11319 by ghoti on Monday 3rd of December 2001 07:28:06 AM
Old 12-03-2001
BASH "if" switches

When I was trying to find these conditional tests, I was finding it very difficult to locate any of these.
Hopefully this list will help for BASH shell users.
Usage:

if [ switch variable ]
eg:

if [ -e "$filename" ]; then
do
something.....
done


where switch and variable are one of the following:

switch variable
-n <variable> tests for non-empty variable
-e <filename> test for existence of file
-L <filename> tests if file is a link to another file
-f <filename> tests if is a regular file
-z <variable> tests if variable is empty
-d <directory> tests for existence of directory
-eq used instead of = (equal)
-neq used instead of != (not equal)
-lt used instead of < (less than)
-gt used instead of > (greater than)
-ge used instead of >= (greater than or equal)
-le used instead of <= (less than or equal)

hope this helps somebody....
 
CVT2PIC(9.1)															      CVT2PIC(9.1)

NAME
cvt2pic, dumppic, ega2pic, face2pic, gif2pic, jpg2pic, nasa2pic, pcx2pic, picopic, sgi2pic, targa2pic, tiff2pic, utah2pic, xbm2pic - con- vert other formats to picture files SYNOPSIS
fb/cvt2pic [ file ] fb/dumppic input xsize ysize channels fb/ega2pic [ file ] fb/face2pic [ facefile ] fb/gif2pic [ -m ] [ -s image ] [ file ] fb/jpg2pic file fb/nasa2pic file fb/pcx2pic [ -r ] [ file ] fb/picopic red green blue xsize ysize fb/sgi2pic file fb/targa2pic [ file ] fb/tiff2pic file fb/utah2pic file fb/xbm2pic [ file ] DESCRIPTION
Cvt2pic examines the given file (default standard input), and tries to convert it to a picfile(9.6). It can recognize TIFF, xbm, Com- puServe GIF, Usenix facesaver, NASA, Utah rle, SGI, JPEG, pcx, and picfile(9.6) images. The actual conversion is done by calling out to one of the programs described below. Although we have programs to decipher EGA, Targa, and raw dump images, cvt2pic cannot recognize them. Dumppic copies input to its standard output, adding a TYPE=dump picture file header. Xsize and ysize are the width and height of the pic- ture. Channels is the value of the output's CHAN= attribute. Face2pic reads facefile (default standard input), a file in the Usenix face- saver format, and converts it to picfile(9.6) format, writing the result on standard output. Picopic creates a TYPE=pico image from the files red, green and blue which must be raw (headerless) dumps in scan line order of size xsizexysize. Ega2pic reads an EGA `enhanced color mode' image from input and converts it to picfile(9.6) format, written on standard output. Gif2pic reads a CompuServe GIF format picture from input (default standard input) and converts it to picfile(9.6) format, written on stan- dard output. By default, it converts its input into a 3-channel rgb image. The -m flag causes it to output a single channel image with a color map. GIF files may contain multiple images; the -s flag allows selection of an image other than the first. Jpg2pic reads a JPEG-coded file in the JFIF format from input (or standard input) and converts it to picfile(9.6) format, written on stan- dard output. It generates TYPE=dump. Nasa2pic reads a NASA satellite image and converts it to picfile(9.6) format, written on standard output. It can decipher only images with a single 8-bit channel. NASA images typically have copious annotations in their headers; these are mostly lost. Sgi2pic converts SGI-format images to picfiles. Targa2pic reads a Targa format file and converts it to picfile(9.6) format, written on standard output. It cannot convert compressed or color-mapped files. Tiff2pic converts TIFF images to picfiles. It cannot handle images with more than 8 bits per color component, nor images of more than 8 channels. It uses a version of Sam Leffler's TIFF library that purports to toe to TIFF 6.0. Utah2pic reads a Utah rle (run-length encoded) image and converts it to picfile(9.6) format, written on standard output. Pcx2pic reads a Paintbrush PCX format picture from input (or standard input) and converts it to picfile(9.6) format, written on standard output. TYPE=dump is generated by default; the -r flag selects TYPE=runcode. Xbm2pic reads an X window-system bitmap file from file (or standard input) and converts it to picfile(9.6) format, written on standard out- put. SEE ALSO
picfile(9.6) Pic2gif contains code that is Copyright (C) 1988, 1989 by Patrick J. Naughton. SOURCE
/sys/src/fb BUGS
The world is awash with raster image file formats, many of which spawn new versions from time to time, possibly making these programs obso- lete. On the other hand, we guarantee unconditionally that picfile(9.6) will never change. CVT2PIC(9.1)
All times are GMT -4. The time now is 03:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy