Sponsored Content
Full Discussion: Whats wrong with this line?
Top Forums Shell Programming and Scripting Whats wrong with this line? Post 302214577 by looza on Monday 14th of July 2008 09:58:00 AM
Old 07-14-2008
$I_FILE="ifile";
where ifile looks like this
4294967295,0,3,2103159,54668771,54668771,0,1,566547,8770,0,384,228,18,12
4294967295,0,4,2103160,54668772,54668772,0,1,566548,8770,0,384,228,18,12
4294967295,1,0,2103161,54668773,54668773,0,3,566549,8770,0,384,228,18,12
4294967295,2,0,2103162,54668774,54668774,0,5,566550,8770,0,384,228,18,12

I need to filter out the first and the ninth column:
4294967295 566547
4294967295 566548
4294967295 566549
4294967295 566550

hence:
system ("awk -F, '{print \$1, \$9}' \$I_FILE | sed '\/^\$\/d' > O_FILE")

I dont *have* to use awk/sed. If there is a simpler way with Perl, that would work too.
Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

whats wrong with this awk???

while read LINE; do echo |awk -v LIN="${LINE}" '{print substr(LIN,1,7)","substr(LIN,8,5)" ,"substr(LIN,14,10)","substr(LIN,24,6)" ,"substr(LIN,30,8)}'; done < exp1.txt exp1.txt = 1234 grgrg 203902 ksdjh oehr weo why it doesn't work?? thanks. (5 Replies)
Discussion started by: george_
5 Replies

2. Shell Programming and Scripting

Whats wrong with this 5 line script!

Hi #!/bin/sh user=$1 if " -eq 0 ] echo "No" else echo "Yes" fi I'm not quite sure whats wrong with this but I know its something silly. Any ideas? Thanks (9 Replies)
Discussion started by: c19h28O2
9 Replies

3. Shell Programming and Scripting

Whats wrong with this script?

Hi all, #!/bin/ksh BIN=/interface/Gunner age=$1 directory="$2" && directory=. cd "$directory" || exit 1 from=`$BIN/today -$age` cd $BIN for i in `cat filestoarchive.txt`;do cd $i find . -mtime 14 | grep -v '.tar$' | $BIN/dttmfilter | awk '$1<="'$from'"{ print;};' | \ done (2 Replies)
Discussion started by: kayarsenal
2 Replies

4. Shell Programming and Scripting

tell me whats wrong in this?

#! /bin/bash head -5 $1 echo "remove $1 ?" read answer if then echo invalid answer elif rm $1 echo "$1 is deleted" elif then echo file is not deleted else echo "invalid answer" fi What i really want this to do is to ask to delete the file or not..it says something wrong... (1 Reply)
Discussion started by: nadman123
1 Replies

5. Shell Programming and Scripting

tell me whats wrong with this

#! /bin/bash USAGE=" | ] if then echo "$USAGE" exit 1 fi while getopts lb: OPTION do case $(OPTION)in a) echo Hi there! exit 2;; b) echo hello o) OARG=$OPTARG;; \?)echo "$USAGE" ;; exit 2;; esac done shift `expr... (1 Reply)
Discussion started by: nadman123
1 Replies

6. Shell Programming and Scripting

whats wrong with this line using perl

E:\>perl -00ne 'push @a,"$_\0$ARGV\n";END{print reverse split/\0/ for sort @a}' file1-obj_prof.out.txt file2-obj_prof.out.txt' Can't find string terminator "'" anywhere before EOF at -e line 1. (6 Replies)
Discussion started by: richsark
6 Replies

7. UNIX for Dummies Questions & Answers

whats wrong with this?

can anyone tell me why this code doesn't work how its supposed to, its the hangman game but it doesn't play how its supposed to #!/bin/bash NoAttempts="0" livesgiven="5" LivesRemain=$livesgiven LettersAttempted="" wordfile=words numwords=0 function menu() { clear cat << menu... (1 Reply)
Discussion started by: ferrycorsten73
1 Replies

8. Shell Programming and Scripting

Whats wrong in the Function ?

Need your assistance, to find the bug in the function. Function usage erroring out even after passing parameters. usage() { if || ; then echo "************************************************************" echo " CHECK USAGE FOR CORRECT PARAMETERS ... (26 Replies)
Discussion started by: raghunsi
26 Replies

9. Homework & Coursework Questions

Whats wrong with the following

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: ls -ld htdocs drwxr-x--- 3 root root 8192 2006-11-19 10:41 htdocs How would a host administrator... (1 Reply)
Discussion started by: Larry_1
1 Replies

10. UNIX for Dummies Questions & Answers

Whats wrong with this if-else

hi whats wrong in below?? CHECK=M10; if ; then echo "hello hi"; else echo "how are u hello hi"; fi I am getting error as ./test.sh: line 2: ' ./test.sh: line 2: M10: command not found ./test.sh: line 2: M10: command not found ./test.sh: line 2: M10: command not found (8 Replies)
Discussion started by: skyineyes
8 Replies
mlib_ImageColorHSL2RGB(3MLIB)				    mediaLib Library Functions				     mlib_ImageColorHSL2RGB(3MLIB)

NAME
mlib_ImageColorHSL2RGB - HSL to RGB color conversion SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageColorHSL2RGB(mlib_image *dst, const mlib_image *src); DESCRIPTION
The mlib_ImageColorHSL2RGB() function performs a conversion from hue/saturation/lightness to red/green/blue. The source and destination images must be three-channel images. It uses the following equations: L' = L if L <= 1/2 L' = 1 - L if L > 1/2 V = L + S*L' P = L - S*L' Q = L + S*L'*(1 - 2*fraction(H*6)) T = L - S*L'*(1 - 2*fraction(H*6)) R, G, B = V, T, P if 0 <= H < 1/6 R, G, B = Q, V, P if 1/6 <= H < 2/6 R, G, B = P, V, T if 2/6 <= H < 3/6 R, G, B = P, Q, V if 3/6 <= H < 4/6 R, G, B = T, P, V if 4/6 <= H < 5/6 R, G, B = V, P, Q if 5/6 <= H < 1 where 0 <= H < 1 and 0 <= S, L, L', V, P, Q, T, R, G, B <= 1. Assuming a pixel in the source image is (h, s, l) and its corresponding pixel in the destination image is (r, g, b), then for MLIB_BYTE images, the following applies: H = h/256 S = s/255 L = l/255 r = R*255 g = G*255 b = B*255 for MLIB_SHORT images, the following applies: H = (h + 32768)/65536 S = (s + 32768)/65535 L = (l + 32768)/65535 r = R*65535 - 32768 g = G*65535 - 32768 b = B*65535 - 32768 for MLIB_USHORT images, the following applies: H = h/65536 S = s/65535 L = l/65535 r = R*65535 g = G*65535 b = B*65535 and for MLIB_INT images, the following applies: H = (h + 2147483648)/4294967296 S = (s + 2147483648)/4294967295 L = (l + 2147483648)/4294967295 r = R*4294967295 - 2147483648 g = G*4294967295 - 2147483648 b = B*4294967295 - 2147483648 PARAMETERS
The function takes the following arguments: dst Pointer to destination image. src Pointer to source image. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_ImageColorHSL2RGB_Fp(3MLIB), mlib_ImageColorRGB2HSL(3MLIB), mlib_ImageColorRGB2HSL_Fp(3MLIB), attributes(5) SunOS 5.11 12 Sep 2007 mlib_ImageColorHSL2RGB(3MLIB)
All times are GMT -4. The time now is 02:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy