C shell script and awk.

From: Hon Seng Phuah (hsphuah_at_usa.com)
Date: 05/24/04

  • Next message: rakesh sharma: "Re: C shell script and awk."
    Date: 23 May 2004 20:24:39 -0700
    
    

    I have wrote these statements and named as loginfo.csh:

    #! /bin/csh

    set filePath = $argv[1]
    set filePath = `echo $filePath | awk '{ split($filePath, subdir, "/");
    for (path
     in subdir) print path}'`

    echo $filePath

    When I ran above code using this command, "loginfo.csh
    /test/good/life", I got these errors:

    awk: Field $() is not correct.
     The input line number is 1.
     The source line number is 1.

    Anyone knows where my problem is?

    Thanks.
    -HS Phuah


  • Next message: rakesh sharma: "Re: C shell script and awk."

    Relevant Pages

    • Re: [opensuse] Need help doing a batch conversation lf - cr/lf
      ... the proper subdir under Dir2. ... It has an option to print file names with NUL termination ... The "xargs" command ... Randal Jarrett ...
      (SuSE)
    • Re: global gtkrc and gtkrc-2.0 location
      ... Ports should keep their config files in /usr/local/etc or a subdir. ... command. ...
      (comp.unix.bsd.freebsd.misc)
    • Re: replacing string in shellscript
      ... On 2005-08-17, Thomas Barth wrote: ... > at the command line the output of ... > is subdir. ... > But I dont get a value if using the statement in a shellscript ...
      (comp.unix.shell)
    • Re: Problem viewing folder and files over tcp/netbui
      ... > Are the symptoms the same in File Open dialogs and at a command prompt? ... File open from an editor fails at ... C:\> I: a `dir' here shows the many subdir at this level ...
      (microsoft.public.windowsxp.general)
    • Re: Is my code wrong?
      ... Bo Yang wrote: ... all subdir but the 'yb' dir and then copy the ... next time run a harmless command first to verify. ... I'd recommand a GUI file manager with a ...
      (comp.unix.shell)