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
DECBIN(3)								 1								 DECBIN(3)

decbin - Decimal to binary

SYNOPSIS
string decbin (int $number) DESCRIPTION
Returns a string containing a binary representation of the given $number argument. PARAMETERS
o $number - Decimal value to convert Range of inputs on 32-bit machines +-------------------------------------+--------------------------------------+---+ | positive $number | | | | | | | | | negative $number | | | | | | | | return value | | | | | | +-------------------------------------+--------------------------------------+---+ | 0 | | | | | | | | | | | | | |T{ 0 | | | | | | | 1 | | | | | | | | | | | | | |T{ 1 | | | | | | | 2 | | | | | | | | | | | | | |T{ 10 | | | | | | | | | | | 2147483646 | | | | | | | | | | | | | |T{ 1111111111111111111111111111110 | | | | | | |2147483647 (largest signed integer) | | | | | | | | | | | | | |T{ 1111111111111111111111111111111 | | | | (31 1's) | | | | | | | 2147483648 | | | | | | | | | -2147483648 | | | | | | | | 10000000000000000000000000000000 | | | | | | | | | | | 4294967294 | | | | | | | | | -2 | | | | | | | | 11111111111111111111111111111110 | | | | | | |4294967295 (largest unsigned inte- | | | |ger) | | | | | | | | | -1 | | | | | | | | 11111111111111111111111111111111 (32 | | | | 1's) | | | | | | +-------------------------------------+--------------------------------------+---+ Range of inputs on 64-bit machines +-------------------------------------+------------------------------------------------------------------+---+ | positive $number | | | | | | | | | negative $number | | | | | | | | return value | | | | | | +-------------------------------------+------------------------------------------------------------------+---+ | 0 | | | | | | | | | | | | | |T{ 0 | | | | | | | 1 | | | | | | | | | | | | | |T{ 1 | | | | | | | 2 | | | | | | | | | | | | | |T{ 10 | | | | | | | | | | | 9223372036854775806 | | | | | | | | | | | | | |T{ | | | | 111111111111111111111111111111111111111111111111111111111111110 | | | | | | |9223372036854775807 (largest signed | | | |integer) | | | | | | | | | | | | | |T{ | | | | 111111111111111111111111111111111111111111111111111111111111111 | | | | (63 1's) | | | | | | | | | | | |T{ -9223372036854775808 | | | | | | | | | 1000000000000000000000000000000000000000000000000000000000000000 | | | | | | | | | | | | | | | |T{ -2 | | | | | | | | | 1111111111111111111111111111111111111111111111111111111111111110 | | | | | | | | | | | |T{ -1 | | | | | | | | | 1111111111111111111111111111111111111111111111111111111111111111 | | | | (64 1's) | | | | | | +-------------------------------------+------------------------------------------------------------------+---+ RETURN VALUES
Binary string representation of $number EXAMPLES
Example #1 decbin(3) example <?php echo decbin(12) . " "; echo decbin(26); ?> The above example will output: 1100 11010 SEE ALSO
bindec(3), decoct(3), dechex(3), base_convert(3), printf(3), using %b, %032b or %064b as the format , sprintf(3), using %b, %032b or %064b as the format . PHP Documentation Group DECBIN(3)
All times are GMT -4. The time now is 05:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy