Can anyone see why this isnt working...?

for line in $(grep "^333#" payRec* | cut -d# -f2); do ((total+=line));
done
grep/cut pipeline is returning three integers, 38, 20, 20.
I want $total to keep a running total, adding them as it goes along. Instead it gets the value of some seemingly unrelated integer, like 480.

I figured it out, by entering
typeset -i sum=0 num
then using those vars for the arithmetic.

Similar Messages

  • Can anyone see why this won't run? I can't seem to figure out the mistake!

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Debugging7 extends JApplet
              implements ItemListener
         //Declare components and global variables here
         JPanel mainPanel = new JPanel();
         JPanel buttonPanel = new JPanel();
         JLabel titleLabel = new JLabel("Debugging - Chapter 7", JLabel.CENTER);
         JTextArea questionTextArea = new JTextArea(2, 35);
         JRadioButton answerARadioButton = new JRadioButton();
         JRadioButton answerBRadioButton = new JRadioButton();
         JRadioButton answerCRadioButton = new JRadioButton();
         JRadioButton answerDRadioButton = new JRadioButton();
         ButtonGroup answerButtonGroup = new ButtonGroup();
         JLabel answerLabel = new JLabel(" ", JLabel.CENTER);
         Font titleFont = new Font("SansSerif", Font.BOLD, 18);
         public void init()
              //Set up the user interface (JPanels) here
              titleLabel.setFont(titleFont);
              mainPanel.setLayout(new GridLayout(0,1));
              mainPanel.add(titleLabel);
              questionTextArea.setText("To respond immediately to a change in the " +
                        "\nstate of a JRadioButton, you need to use: ");
              mainPanel.add(questionTextArea);
              questionTextArea.setEnabled(false);
              answerButtonGroup.add(answerARadioButton);
              answerButtonGroup.add(answerBRadioButton);
              answerButtonGroup.add(answerCRadioButton);
              answerButtonGroup.add(answerDRadioButton);
              buttonPanel.setLayout(new GridLayout(0, 4));
              answerARadioButton.setText("an ActionListener");
              buttonPanel.add(answerARadioButton);
              answerBRadioButton.setText("a compareTo method");
              buttonPanel.add(answerBRadioButton);
              answerCRadioButton.setText("an ItemListener");
              buttonPanel.add(answerCRadioButton);
              answerDRadioButton.setText("none of the above");
              buttonPanel.add(answerDRadioButton);
              mainPanel.add(buttonPanel);
              mainPanel.add(answerLabel);
              answerLabel.setForeground(Color.red);
              answerLabel.setFont(titleFont);
              setContentPane(mainPanel);
              //Add listeners
              answerARadioButton.addActionListener(this);
              answerBRadioButton.addActionListener(this);
              answerCRadioButton.addActionListener(this);
              answerDRadioButton.addActionListener(this);
         public void itemStatePerformed(ActionEvent event)
              //Retrieve user input and respond with calculations, etc
              Object eventSource = event.getSource();
              if(event == answerARadioButton)
                   answerLabel.setText("an ActionListener is NOT correct");
              else if(event == answerBRadioButton)
                   answerLabel.setText("a compareTo method is NOT correct");
              else if(event == answerCRadioButton)
                   answerLabel.setText("an ItemListener IS CORRECT");
              else if(event == answerDRadioButton)
                   answerLabel.setText("none of the above is NOT correct");
              else
                   answerLabel.setText("answer the question, please!");
    }

    Okay, here's some compiling code... Although I don't really want to bother to write up the html to test it so I'll leave that up to you...
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Debugging7 extends JApplet
              implements ItemListener
         //Declare components and global variables here
         JPanel mainPanel = new JPanel();
         JPanel buttonPanel = new JPanel();
         JLabel titleLabel = new JLabel("Debugging - Chapterr 7", JLabel.CENTER);
         JTextArea questionTextArea = new JTextArea(2, 35);
         JRadioButton answerARadioButton = new JRadioButton();
         JRadioButton answerBRadioButton = new JRadioButton();
         JRadioButton answerCRadioButton = new JRadioButton();
         JRadioButton answerDRadioButton = new JRadioButton();
         ButtonGroup answerButtonGroup = new ButtonGroup();
         JLabel answerLabel = new JLabel("       ", JLabel.CENTER);
         Font titleFont = new Font("SansSerif", Font.BOLD, 18);
         public void init()
              //Set up the user interface (JPanels) here
              titleLabel.setFont(titleFont);
              mainPanel.setLayout(new GridLayout(0,1));
              mainPanel.add(titleLabel);
              questionTextArea.setText("To respond immediately to a change in the " +
                        "\nstate of a JRadioButton, you need to use: ");
              mainPanel.add(questionTextArea);
              questionTextArea.setEnabled(false);
              answerButtonGroup.add(answerARadioButton);
              answerButtonGroup.add(answerBRadioButton);
              answerButtonGroup.add(answerCRadioButton);
              answerButtonGroup.add(answerDRadioButton);
              buttonPanel.setLayout(new GridLayout(0, 4));
              answerARadioButton.setText("an ActionListener");
              buttonPanel.add(answerARadioButton);
              answerBRadioButton.setText("a compareTo method");
              buttonPanel.add(answerBRadioButton);
              answerCRadioButton.setText("an ItemListener");
              buttonPanel.add(answerCRadioButton);
              answerDRadioButton.setText("none of the above");
              buttonPanel.add(answerDRadioButton);
              mainPanel.add(buttonPanel);
              mainPanel.add(answerLabel);
              answerLabel.setForeground(Color.red);
              answerLabel.setFont(titleFont);
              setContentPane(mainPanel);
              //Add listeners
              answerARadioButton.addItemListener(this);
              answerBRadioButton.addItemListener(this);
              answerCRadioButton.addItemListener(this);
              answerDRadioButton.addItemListener(this);
         public void itemStateChanged(ItemEvent event)
              //Retrieve user input and respond with calculations, etc
              Object eventSource = event.getSource();
              if(eventSource.equals(answerARadioButton))
                   answerLabel.setText("an ActionListener is NOT correct");
              else if(eventSource.equals(answerBRadioButton))
                   answerLabel.setText("a compareTo method is NOT correct");
              else if(eventSource.equals(answerCRadioButton))
                   answerLabel.setText("an ItemListener IS CORRECT");
              else if(eventSource.equals(answerDRadioButton))
                   answerLabel.setText("none of the above is NOT correct");
              else
                   answerLabel.setText("answer the question, please!");
    }Message was edited by:
    Dalzhim

  • I can't deauthorize all computers. It acts like it is doing it, but it never succeeds and no message returns saying why it didn't work. Can anyone explain why this is happening?

    I had to rebuild a computer. When I got iTunes installed and tried to sync my iPod it said that I had reached my limit of five computers. I logged into my iTunes account and went through the process for deauthorizing all computers. It comes up with a messaging asking if I am sure I want to deauthorize all computer and I select the "Deauthorize computers" button. It never comes back with a message one way or another whether it was successful. When I get out of that screen and come back in, it still shows that I have 5 authorized computers. I can't sync my iPod. The deauthorization is not working. Can anyone explain why this is happening?

    i guess no one helped? I'm having the same problem.
    When i press the button to deauthorize all computers, i get an error saying 'my account can't process this at this time. please try again later'

  • My ipod 60gb classic is showing as fully charged until I connect it to my pc when it comes up with the error message, 'please wait very low battery' and the little wheel goes round and nothing happens, can anyone explain why this is and what i can do?

    My ipod 60gb classic is showing as fully charged until I connect it to my pc when it comes up with the error message, 'please wait very low battery' and the little wheel goes round and nothing happens, can anyone explain why this is and what i can do?

    I have worked my way through the assistant and nothing works. I have tried connecting in disc mode but although the screen on the ipod is showing that the device is charged and that it is in disc mode as soon as I connect it to the computer it comes up with the error message 'please wait very low battery' and stays like that until I disconnect when it appears to be OK again. I have tried on both pc and mac.
    BTW the ipod is an ipod video not classic if that makes any difference.
    Thanks

  • I recently installed Acrobat Pro X on my Mac. I initially accepted the terms of agreement, but then every few seconds the same prompted window for the terms of agreement keeps popping up. Can anyone explain why this is happening, and how to resolve?

    I recently installed Acrobat Pro X on my Mac. I initially accepted the terms of agreement, but then every few seconds the same prompted window for the terms of agreement keeps popping up. Can anyone explain why this is happening, and how to resolve?

    Have you tried reinstalling the original drive? Same symptoms with it?

  • Can anyone see in this code why my insert and check username function is not working?

    Hi guys.
    I have an error that has me stumped.
    I have a form that inserts text from a text field into a
    mysql database and I have added a check user name function to check
    if this number already exists.
    Here's the page
    http://www.thechallenge.net.au/redemption2.php
    The error I get when using the page on the web is this
    Duplicate entry '' for key 1
    Can anyone help with this?

    ducati1 wrote:
    > Ok we are now getting somewhere.
    > I have reset the mysql database as recommended and
    everything works Except the
    > pay pal receipt number is being entered into the
    database as only numbers and
    > no letters. For example when I entered 123456f it went
    to the database as
    > 123456 with no "f".
    > What should I set the database and text field properties
    to so it records all
    > that might be in a pay pal receipt number?
    I noticed previously you changed it to int, that means
    integer, which is
    a numeric datatype.
    You want mixed characters and numbers? Is it always the same
    length? If
    it is, use a CHAR datatype and set it to the length you need,
    CHAR(12)
    for instance will let you use 12 characters. Even if the
    number entered
    isn't 12 characters, it will be stored as 12 characters, but
    with spaces
    where there are no characters. I personally never use this
    unless I am
    100% certain that its going to be exactly the same length,
    otherwise
    doing comparisons is problematic, as you need to TRIM the
    white space.
    If the length is going to vary, then use VARCHAR(12), this
    let you use
    up to 12 characters. It won't put extra spaces in. This is my
    preference.
    Now, if you are also storing double byte characters, like
    foreign
    characters, you might want to consider using NVARCHAR or
    NCHAR.
    Oh, these examples are based on MS SQL datatypes, so MySQL
    might be
    slightly different, so it may be worth checking the manual
    first.
    Dooza

  • Can anyone explain why this keeps appearing whenever I start my computer?

    Can anyone tell me what this means and how I can get rid of it? It's really annoying me! Appears on screen each time I start my computer up.
    Cheers.

    You've probably got hard disk corruption or malware on your computer. Run a virus scan with a recently update antivirus. Next, reinstall iTunes as described here: http://support.apple.com/kb/HT1925.
    Follow the instructions exactly, and do not skip any steps.

  • Logon trigger - Can anyone else get this to work? [SOLVED]

    I have a button on my canvas. My push button code below is designed to change the form's connection from one database (Production) instance to another (Test). I want to do this so that I can change data without concern. But the code always generates the following pop-up error message when I press my button:
    FRM-40735: When Button Pressed Trigger Raised Unhandled Exception ORA-03114
    I have no idea why this is occuring, especially since the is no other code is in my When-Button-Pressed trigger.
    Are you able to run this code? Any suggestions for solving this pop-up error issue? Any help would be greatly appreciated.
    Push Button Code:
    =================
    message(upper(get_application_property(connect_string)));
    message(upper(get_application_property(connect_string)));
    :global.pw := get_application_property(password);
    logout;
    LOGON(user,:global.pw||'@FCTEST');
    message(upper(get_application_property(connect_string)));
    message(upper(get_application_property(connect_string)));

    After you logout, USER is no longer available.
    You need to store USER in a variable, then use the variable in the logon command. You do not need to use a global at all here -- use local variables for everything.
    Here is code I use in a form just to restart the session:
    Declare
      CN Varchar2(30) := Get_Application_Property(CONNECT_STRING);
      UN Varchar2(30) := Get_Application_Property(USERNAME);
      PW Varchar2(50) := Get_Application_Property(PASSWORD);
    Begin
      logout;
      logon(UN,PW||'@'||CN);
      Message('  New session started.  Connected to '||UN||' @'||CN
          ,no_acknowledge);
    End;

  • Simple? can anyone tell why this simple btn doesn't work?

    Trying to write my own simple disabling button class (with
    some help from friend - thanks LuigiL)
    So, why does my button not turn off when clicked? it runs the
    deinitializeBehavior function but the removeEventListeners are not
    actually being removed...
    I don't know why but could this possibly be a graphics issue?
    Thanks in advance

    HAH! OK - I am starting to get this a little.
    Thank you St. LuigiL. You are my Obie-wan: the force is
    strong with you.
    I made a Main.as document class and now the whole thing works
    like a charm! I was wondering if it was necessary to do so - and it
    was.
    In my OCD I am constantly striving to keep my classes to a
    bare minimum (if I could write everything on one page I would.)
    I very much appreciate your incredible help and support.
    BAM

  • Can't see why this won't work

    I have a table customer that I am trying to update with some details from another table:
    update customer
    set credit_limit = (select cr.credit_limit
                        from credit_limits cr)
    where customer.state = cr.state
    and customer.credit_limit is null;
    I keep getting the error:
    "CR"."STATE": invalid identifier
    Why won't it recognise the credit_limits table even though I have called it cr? I need to be make sure the states in the customer and credit_limits table match before inserting the new credit_limit into the customer table

    I have a table customer that I am trying to update
    with some details from another table:
    update customer
    set credit_limit = (select cr.credit_limit
                        from credit_limits cr)
    where customer.state = cr.state
    and customer.credit_limit is null;
    I keep getting the error:
    "CR"."STATE": invalid identifier
    Why won't it recognise the credit_limits table even
    though I have called it cr? I need to be make sure
    the states in the customer and credit_limits table
    match before inserting the new credit_limit into the
    customer tableThe syntax is not correct. It should be :
    update customer
    set credit_limit = (select cr.credit_limit
                        from credit_limits cr
                        where customer.state = cr.state)
    where customer.credit_limit is nullMessage was edited by:
    Michel

  • Can _you_ see why this HTTP POST doesn't work?

                URL url = new URL(SOAPurl);
             URLConnection connection = url.openConnection();
                httpConn = (HttpURLConnection)connection;          
             httpConn.setRequestProperty( "Content-Length", String.valueOf( byteArray.length ));                  httpConn.setRequestProperty("Content-Type","text/xml;charset=ISO-8859-1");
                httpConn.setRequestMethod( "POST" );
                httpConn.setDoOutput(true);
                httpConn.setDoInput(true);
                // Everything's set up; send the XML that was read in to b.
                OutputStream out = httpConn.getOutputStream();
                out.write( b );
                out.close();The code above will activate my servlet's doGet() method, not doPost()
    shouldn't the setRequestMethod("POST") be enough to indicate that this is a POST not a GET?
    - bjorn

    Using the code found here: http://www.javaworld.com/javaworld/jw-03-2001/jw-0323-traps.html
    I am able to invoke the doPost() method in my servlet, but the POST data is empty, here is what my servlet prints to standard out:
    Post Recieved
    Header Namer: content_length -- Value : 35
    Header Namer: user-agent -- Value : Java/1.4.1_01
    Header Namer: host -- Value : 127.0.0.1:8080
    Header Namer: accept -- Value : text/html
    Header Namer: accept -- Value : image/gif
    Header Namer: accept -- Value : image/jpeg
    Header Namer: accept -- Value : *; q=.2
    Header Namer: accept -- Value : */*; q=.2
    Header Namer: connection -- Value : keep-alive
    Header Namer: content-type -- Value : application/x-www-form-urlencoded
    Header Namer: content-length -- Value : 35
    InputStream.isavailable()=0
    What we recieved: (0)
    Servlet doPost() method:
        public void doPost( HttpServletRequest req, HttpServletResponse resp ) {
            System.out.println("Post Recieved");
            MimeHeaders headers = getHeaders(req);
            Iterator it = headers.getAllHeaders();
            while(it.hasNext()) {
                MimeHeader header = (MimeHeader)it.next();
                System.out.print("Header Namer: " + header.getName());
                System.out.println(" -- Value : " + header.getValue().toString());
            try {
                InputStream is = req.getInputStream();
                byte[] b = new byte[]{};
                System.out.println("InputStream.isavailable()=" + is.available());
                int numbytesread = is.read(b,0,is.available());
                System.out.println("What we recieved: (" + numbytesread + ")\n" + b.toString());
                PrintWriter out = resp.getWriter();
                System.out.println("Running runQuery() - "+queries.get(dbQueryNum));
                String xml = dbconn.runQuery(queries.get(dbQueryNum).toString());
                //System.out.println("returned from runQuery()\n"+xml);
                System.out.println("size of returned XML: "+xml.length());
                out.write(xml);
            } catch (IOException ioe ) { // throwed by getInputStream()
                ioe.printStackTrace();
        }

  • Can anyone explain why this site is so slow to load?

    Strangely, it pops up fine in Safari but is excruciatingly slow to load in Firefox and IE (with graphics and some of the audio player icons not showing for literally multiple minutes, etc.):
    http://ddjackson.net/D.D.JacksonDemos.html
    Any help would be EXTREMELY appreciated!
    - D.D.

    You may be better served by making a new page for each audio file.
    The page loads slowly because each of the 8 MP3's must begin their download before the next page element can be downloaded. They don't have to completely download (just start) and the QuickTime browser plug-in will be used to play them.
    Each time your page loads completely you're using over 50MB's of your bandwidth limits. This could become expensive if you have bandwidth pricing.
    Consider using just a minute of each MP3 in the QuickTime .mov container with a link to the entire file (as you have now) in MP3 format. Saves bandwidth and speeds up the page load time.

  • When i delete a app i have had the dreaded black screen and i have to put my iphone 5 in dfu mode and restore it can anyone explain why this happens

    when i delete a app my screen goes black and i have to put in dfu mode and restore it didnt happen till i upgraded software any reason for this

    When in DFU mode and connected to the computer iTunes does not say anything but iTunes will see the iPod and you can restore the iPod via iTunes. When in recovery mode and you connect, iTunes will say it found an iPod in recovery mode.

  • My Magic Mouse loses its connection randomly and then re-connects later. Can anyone suggest why this happens? The batteries are fresh.

    Lately my magic mouse has been losing its connection quite randomly. It usually reconnects soon after. I bought a cheap USB mouse to keep me going during these unexpected down-times. The batteries are fresh and the switch is on. I've uninstalled and re-installed the mouse in Bluetooth, but the problem recurs.

    Try a PRAM reset.  That usually helps bluetooth problems.
    http://support.apple.com/kb/ht1379
    There are some other causes relating to rechargable batteries, see this thread:
    https://discussions.apple.com/thread/3058776?tstart=0
    Regards,
    Captfred

  • Can anyone say why this basic PB crashes AE?

    Hi,
    I wrote a basic light wrap filter - it works in PB but crashes AE immidiately when I apply the filter to a layer.
    <languageVersion : 1.0;>
    kernel efx_lightwrap
    <   namespace : "efx LightWrap";
        vendor : "EFX Filip Kaczorek";
        version : 1;
        description : "LightWrap";
        displayname : "EFX LightWrap";
        category : "EFX";
    >
        dependent float maxd;
        dependent float fgam;
        input image4 src;
        output pixel4 dst;
       parameter float thr
            <
                minValue: 0.0;
                maxValue: 0.99;
                defaultValue: 0.99;
                aeDisplayName: "alpha threshold";
            >;
       parameter int rad
            <
                minValue: 0;
                maxValue: 20;
                defaultValue: 1;
                aeDisplayName: "radius";
            >;
       parameter float gam
            <
                minValue: 0.0;
                maxValue: 1.0;
                defaultValue: 1.0;
                aeDisplayName: "falloff shape";
            >;
       parameter float ammount
            <
                minValue: 0.0;
                maxValue: 1.0;
                defaultValue: 1.0;
                aeDisplayName: "ammount";
            >;
       parameter pixel3 lightcol
        <
            minValue: pixel3(0.0,0.0,0.0);
            maxValue: pixel3(1.0,1.0,1.0);
            defaultValue: pixel3(0.0,0.0,1.0);
            description: "Light color.";
            parameterType: "colorRGB";
            aeDisplayName: "Light color";
            aeUIControl: "aeColor";
        >;
      void evaluateDependents()
           maxd=distance( float2(0.0,0.0),float2(float(rad),float(rad)) );
            fgam=8.0*gam-7.0;
       pixel4 check(pixel4 this_p){
            float dist=9999.0;
            this_p.a=0.0;
            pixel4 p=pixel4(0.0);
            float td=0.0;
            int i=0;
            int j=0;
            for(i = -rad; i <= rad; i++)
                      for(j = -rad; j <= rad; j++)
                          p=sampleNearest(src,outCoord() + float2(float(i),float(j)));
                          if(p.a<thr){
                                 td=distance( float2(0.0,0.0),float2(float(i),float(j)) );
                                 if(dist>td){dist=td;}
            if(dist<9999.0){
                this_p.a=1.0-(dist/maxd);
                this_p.a=pow(this_p.a,(1.0-fgam));
                this_p.rgb=lightcol;
            return this_p;
        void
        evaluatePixel()
            pixel4 s_pix=sampleNearest(src,outCoord());
            pixel4 t_pix=s_pix;
            pixel4 lw_pix=s_pix;
            if(s_pix.a>thr){
                   lw_pix=check(lw_pix);  
            if(lw_pix.a>0.0){
                 t_pix.rgb=s_pix.rgb+(lw_pix.rgb*pixel3(lw_pix.a*ammount));
            dst = t_pix;
    After some experimenting I think it has something to do with sampling the input image inside the check() function.
    If I replace the sampled values with constant ones - it doesn't crash.
    If I move all the calculations up to the main evaluatePixel() function - it doesn't crash.
    I'd call it a day with that conclusion if it wasn't for the fact that this is basically my template PB and I have many PB filters built exactly the same way that don't crash.
    Including a Gaussian Filter that does way more sampling within its sub-function.
    So any ideas?

    In Pixel Bender it runs in both modes.
    It crashes on 3 different machines, although all HP
    Two different workstations and a laptop (so xeons and i7, FireGLv5600, Quadro 4800, GF230 mobile).
    All Win7 x64 and AE CS5.
    Like I said, it crashes AE even if I strip the code to only one line in the function: p=sampleNearest...
    This seems to be the only thing that gives problems.
    Weird thing, THIS IS almost my template filter - I start all my filters looking like that and that one is THE ONLY ONE crashing???
    The solution i found was to move the code into the main body - not use a subfunction. Now it works great, though the esthetics of the code suffer

Maybe you are looking for

  • Automatic variable Change of the Place item on a action

    I'm begining in the scripting area, but I'm lost realy.  I looking in a way to change the place automatic based on the filename/ folder. Today I do like this: I'm aplying a image in the back of a photo with automate batch. My actions goes in resume l

  • Premiere Pro and Media Encoder crash while rendering H.264

    Very recently, a problem's popped up where Premiere Pro and Media Encoder (CC) will crash while rendering H.264. It's only while rendering H.264 - other formats seem to work fine. And I don't mean that it returns an error, I mean it hard crashes with

  • Problem with alv to spread sheat  ( EXCEL )

    Hello all , I am getting the correct out in ALV out put but when i down load to spread sheat using ( cntrl + shift + F9 ) i am getting out put like this for the below two fields The field catelog is like this ..   lfl_fieldcat-col_pos       =  l_pos.

  • Add-ons manager doesn't load

    I am at wits end... I have tried every solution to get the add-ons manager to load and nothing has worked. If you might know of a solution please let me know. I am running Firefox 11, Windows 7 and I have checked for and updated a plug-in. I even cli

  • Installation of ColdFusion

    During the installation of Coldfusion on my system, it gives me the following install options that I must select from. Please advise as to which selection I should make: 1. Server Configuration Install ColdFusion MX 7 as a self-contained server. Simi