Find the answer to your Linux question:
Results 1 to 3 of 3
I have a task of migrating scripts from SunOS to Linux, tehre is a .awk file, which has a function double e.g double(substr("abcwertert", 7,1)); it works perfectly on SunOS but ...
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    11

    does double() work on UNIX?

    I have a task of migrating scripts from SunOS to Linux, tehre is a
    .awk file, which has a function double

    e.g
    double(substr("abcwertert", 7,1));
    it works perfectly on SunOS but on Linux it says,

    awk: test.awk:6: fatal: function `double' not defined

    please help

    thank you

  2. #2
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    it should be a user defined function in awk from Solaris version.
    show the whole code if you can

  3. #3
    Just Joined!
    Join Date
    Dec 2007
    Posts
    11
    sym = substr($0,1,11);
    if (sym ~ /\t/) sym = sprintf("%-11.11s",substr(sym,1,index(sym,"\t")-1));
    Symbol [ symcounter ] = sym;
    SymbolStatus [ sym ] = 1;
    BaseValue [ sym ] = double(substr($0, 12,length-11));

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...