Sponsored Content
Top Forums Shell Programming and Scripting Please can any one explain this ${0##/} Post 302180895 by gadege on Tuesday 1st of April 2008 11:41:48 AM
Old 04-01-2008
Please can any one explain this ${0##/}

I did not understand what is ${0##/}

PGM=${0##/}
TMP=/tmp/${PGM}.$$


Please explain me.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

please explain this

zsh 4.3.4% cat file ACFCFACCACARCSHFARCVJVASTVAJFTVAJVGHBAJ zsh 4.3.4% cat file1 A C F R zsh 4.3.4% <file1 while read;do printf "%s=%d\n" "$REPLY" "${#$(<file)//}";done A=9 C=7 F=4 R=2 That was the previous post. But , can anybody can explain me in detail about this line zsh... (2 Replies)
Discussion started by: dummy_needhelp
2 Replies

2. Shell Programming and Scripting

please explain the below

could u please convert the below statement to shell script ---------- logdir=/smp/dyn/logfiles/cpm/pgm/pgIm $logdir = $logdir ."/pgIm${toDate}*"; ---- could u please explain the below clearly grep -i adding $logdir | grep -iv equation | awk '{print \$NF}' | sort -u | sed -e... (1 Reply)
Discussion started by: mail2sant
1 Replies

3. AIX

can anyone explain this?

this is the mksys b script.... can anyone explain .. what # and 1 in if condition this is the first line of the script... it is not from middle of the script.... if then echo "Not enough parameters, need a client name for mksysb" Usage="Usage: $0 <client name>" ... (2 Replies)
Discussion started by: honeym210
2 Replies

4. UNIX for Dummies Questions & Answers

Please explain this

if then echo "Syntax: $0 <sid> <COLD/HOT> <DEST>" exit fi if --------------what does this mean??? echo "Syntax: $0 <sid> <COLD/HOT> <DEST>"---pls explain this as well (2 Replies)
Discussion started by: appsdba.nitin
2 Replies

5. Shell Programming and Scripting

can any one explain this example

hi all i have an example i want one help me to understand cause i tried to test it but almost fail and i don't know how can i solve this problem " the main idea to read from two files and replace something from one to another " but i don't understand why it fail all time $ cat main.txt... (4 Replies)
Discussion started by: maxim42
4 Replies

6. Homework & Coursework Questions

Could anyone help explain this?

1. The problem statement, all variables and given/known data: I have a retake assignment to complete for my computer networks and OS class. This isn't really my area, had I known last year I could have swapped it for a different module I would have done so. I'm determined to get through it... (6 Replies)
Discussion started by: Squall Moogle
6 Replies

7. Shell Programming and Scripting

Explain $# please

I'm trying to follow a script and I see it begins with this: if ; then if ; then print "blah $0 blah blah " exit fi fi What does $# mean? I found out that $1 refers to the shell environment and the last argument that was entered or passed in the previous command. I couldn't find $#... (2 Replies)
Discussion started by: MaindotC
2 Replies

8. Shell Programming and Scripting

anyone can explain this?

why the case 2 will happen ? , ' should stop the history substitution ,shouldn't it? case 1 # echo "123"|sed '/123/!d' 123 case 2 # echo "123 > 456 > 1 > "|sed '/123/!d' -bash: !d': event not found case 3 # echo "123 > 456 > 12 > "|sed '/123/'\!d 123 # bash --version (1 Reply)
Discussion started by: justlooks
1 Replies

9. Shell Programming and Scripting

Can someone explain this for me?

Can someone do me a favour and explain the following for me: ((r=$RANDOM%$n+1)) I know what $RANDOM does but what is % sign and what does it do with %$n+1? (2 Replies)
Discussion started by: bashily
2 Replies

10. UNIX for Dummies Questions & Answers

How I can explain this?

Hi friends! I'm learning UNIX and I have a small question. Working with Shell, i put the name of one executable (in c language) + one number and it says this: $ gcc misterioso_4.c $ ./misterioso_4 6 got: , I can not find an answer in the manual because I havent applied any variable.... (5 Replies)
Discussion started by: dakota
5 Replies
libpgm(3)                                                    Library Functions Manual                                                    libpgm(3)

NAME
libpgm - functions to support portable graymap (PGM) programs SYNOPSIS
#include <pgm.h> void pgm_init( int *argcP, char *argv[] ); gray ** pgm_allocarray( int cols, int rows ); gray * pgm_allocrow( intcols ); void pgm_freearray( gray **grays, introws ); void pgm_freerow( gray *grayrow); void pgm_readpgminit( FILE *fp, int *colsP, int *rowsP, gray *maxvalP, int *formatP ); void pgm_readpgmrow( FILE *fp, gray *grayrow, int cols, gray maxval, int format ); gray ** pgm_readpgm( FILE *fp, int *colsP, int *rowsP, gray *maxvalP ); void pgm_writepgminit( FILE * fp , int cols, int rows, gray maxval, int forceplain ); void pgm_writepgmrow( FILE *fp, gray *grayrow, int cols, gray maxval, int forceplain ); void pgm_writepgm( FILE *fp, gray ** grays, int cols, int rows, gray maxval, int forceplain ); void pgm_writepgm( FILE *fp, gray **grays, int cols, int rows, gray maxval, int forceplain ); void pgm_nextimage( FILE *file, int * const eofP); void pgm_check( FILE * file, const enum pm_check_type check_type, const int format, const int cols, const int rows, const int maxval, enum pm_check_code * const retval); typedef ... gray; #define PGM_MAXMAXVAL ... #define PGM_OVERALLMAXVAL ... extern gray pgm_pbmmaxval; #define PGM_FORMAT ... #define RPGM_FORMAT ... #define PGM_TYPE PGM_FORMAT #define PGM_FORMAT_TYPE(format) ... DESCRIPTION
TYPES AND CONSTANTS Each gray should contain only the values between 0 and PGM_OVERALLMAXVAL. pgm_pbmmaxval is the maxval used when a PGM program reads a PBM file. Normally it is 1; however, for some programs, a larger value gives better results. PGM_OVERALLMAXVAL is the maximum value of a maxval in a PGM file. PGM_MAXMAXVAL is the maximum value of a maxval in a PGM file that is compatible with the PGM format as it existed before April 2000. It is also the maximum value of a maxval that results in the minimum pos- sible raster size for a particular image. I.e an image with a maxval higher than PGM_MAXMAXVAL cannot be read or generated by old PGM pro- cessing programs and requires more file space. PGM_FORMAT is the format code for a Plain PGM format image file. RPGM_FORMAT is the format code for a Raw PGM format image file. PGM_TYPE is the format type code for the PGM formats. PGM_FORMAT_TYPE is a macro that generates code to compute the format type code of a PBM or PGM format from the format code which is its argument. INITIALIZATION All PGM programs must call pgm_init() just after invocation, before they process their arguments. MEMORY MANAGEMENT pgm_allocarray() allocates an array of grays. pgm_allocrow() allocates a row of the given number of grays. pgm_freearray() frees the array allocated with pgm_allocarray() containing the given number of rows. pgm_freerow() frees a row of grays allocated with pgm_allocrow(). READING FILES If a function in this section is called on a PBM format file, it translates the PBM file into a PGM file on the fly and functions as if it were called on the equivalent PGM file. The format value returned by pgm_readpgminit() is, however, not translated. It represents the actual format of the PBM file. pgm_readpgminit() reads the header of a PGM file, returning all the information from the header and leaving the file positioned just after the header. pgm_readpgmrow() reads a row of grays into the grayrow array. format, cols, and maxval are the values returned by pgm_readpgminit(). pgm_readpgm() reads an entire PGM image into memory, returning the allocated array as its return value and returning the information from the header as rows, cols, and maxval. This function combines pgm_readpgminit(), pgm_allocarray(), and pgm_readpgmrow(). WRITING FILES pgm_writepgminit() writes the header for a PGM file and leaves it positioned just after the header. forceplain is a logical value that tells pgm_writepgminit() to write a header for a plain PGM format file, as opposed to a raw PGM format file. pgm_writepgmrow() writes the row grayrow to a PGM file. For meaningful results, cols, maxval, and forceplain must be the same as was used with pgm_writepgminit(). pgm_writepgm() write the header and all data for a PGM image. This function combines pgm_writepgminit() and pgm_writepgmrow(). MISCELLANEOUS pgm_nextimage() positions a PGM input file to the next image in it (so that a subsequent pgm_readpgminit() reads its header). pgm_nextimage() is analogous to pbm_nextimage(), but works on PGM and PBM files. pgm_check() checks for the common file integrity error where the file is the wrong size to contain all the image data. pgm_check() is analogous to pbm_check(), but works on PGM and PBM files. SEE ALSO
libpbm(3), libppm(3), libpnm(3) libpgm(3)
All times are GMT -4. The time now is 02:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy