Problem with unix "foreach" command

Hi,
I am facing a problem with unix command "foreach". I trying to process files using unix foreach command. When running the script with 500 or 1000 files. It is running fine. But when I am trying to the script with 2000+ files. Its throwing an error "Arguments too long".
below is the syntax I am using in the script:
foreach name (*)
end
Could anybody help me on this issue.
Thanks in Advance.
Manasa.

UNIX/Linux systems expand wildcards onto the command line before invoking the
individual commands. In effect, the shell rewrites the command line you give
substituting the wildcard expansion. There is a limit to how long this command
line can get.
For example, suppose you have two files ("foo" and "bar") in your directory.
The line:
foreach name (*)
  echo $name
endgets rewritten to:
foreach name (foo bar)
  echo $name
endand then the shell starts interpreting your script. So if you have many, many
files, the rewritten line becomes:
foreach name (f1 f2 f3 ... f10927)
  echo $name
endso chances are the "foreach" line simply gets too long. To avoid problems do
it this way; it avoids any problems based on how many files you have:
ls | while read name
do
  echo $name
doneThis way the shell never exceeds its line length limitations because the
wildcard is never expanded.
Cheers

Similar Messages

  • Problem with 'Edit Locally' command -- Due to IISProxy?

    Hi,
    We have a problem with 'Edit Locally' command since we are using Windows Authentication. Our architecture is:
    SAP EP 6.0 SP2 Patch 28 (Solaris)
    IIS Proxy (Windows 2003)
    The situation is:
    If we access to SAP Portal using old url (directly to Solaris) using form-based authentication we do not have any problem with 'edit locally' command.
    However, if we access to SAP Portal using IISProxy and Windows Authentication we get an 'Operation failed' error message.
         Java plug-in console shows the following message:
    cargar: clase com/sapportals/wcm/app/docapplet/DocApplet.class no encontrada.
    java.lang.ClassNotFoundException: com.sapportals.wcm.app.docapplet.DocApplet.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    Where is the problem? Is due to authentication method? SAP Portal or IISProxy configuration?
    Thanks,

    Thanks for your comment,
    Now, we have tested with version 1.5.0_01 plugin version but the result is the same: 'Operation failed'
    This is a very important topic to solve before installing Windows Authentication in a productive environment.
    Has anybody any solution?
    Damiá

  • Problems with the vba command sendkeys in Access 2013.

    Hi, I have problems with the vba command sendkeys in Access 2013.
    I use a text field (no control) in a form. By means of the VBA command SendKeys "+ {DELETE}", 1  I get the text in memory from the text field, then place (paste) the text in a Word document. The command line sendkeys
    is followed by moving the focus to a particular control. In Access 2003, which went smoothly. Now the sendkeys command is executed only in Access 2013 in the control that then receives focus. If the procedure ends with the sendkeys command then it works well.
    The procedure with the sendkeys command is activated by a button on a form.
    Who can help me?
    private user

    Hi H.Plmp,
    Based on the description, you want to call the sendkeys from a button.
    >> use a text field (no control) in a form. By means of the VBA command SendKeys "+ {DELETE}", 1  I get the text in memory from the text field<<
    What did you mean that you no control? And how did you get the text in memory from the text field? Also I am not able to understand the exact reason that the command doesn't works in Access 2013.
    And based on the test, sendkeys "+ {Delete}" works well for me when I set a focus for the textbox control. Here is th test code:
    Me.Controls("txtField1").SetFocus
    SendKeys "+ {DELETE}", 1
    If I misunderstood, please feel free to let me know.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Just installed Lion and the Magic TrackPad and I am having a problem with one click commands.  I have to hit the pad fairly hard with one finger to get it to accept the command.  Is this normal, is there another way that I am suppose to execute commands?

    Just installed Lion and the Magic TrackPad and I am having a problem with one click commands.  I have to hit the pad fairly hard with one finger to get it to accept the command.  Is this normal, is there another way that I am suppose to execute commands?

    No you just need to turn on Tap to Click. Go into System Preferences - Trackpad and click the Point to Click tab and select the first box which will say Tap to Click and you should be in business.

  • GUI problem with UNIX

     

    Hi Vasundhara,
    Try grouping the widgets in to a panel.
    Thanks,
    Madhu
    -----Original Message-----
    From: vasundhara [mailto:[email protected]]
    Sent: Wednesday, April 25, 2001 9:15 AM
    To: [email protected]; Joseph Mirwald
    Subject: Re: (forte-users) GUI problem with UNIX
    Hi Joseph
    We are using Forte 3.0 M2 on Solaris 5.8 The problem is with the push
    buttons, After we grid the controls and they look intact in the NT
    environment, but when we open the same window in SOlaris the controls are
    far apart.Do you have any idea about this?
    Regards
    Vasundhara
    ----- Original Message -----
    From: Joseph Mirwald <mailto:[email protected]>
    To: vasundhara <mailto:[email protected]> ;
    [email protected] <mailto:[email protected]>
    Sent: Wednesday, April 25, 2001 10:13 AM
    Subject: Re: (forte-users) GUI problem with UNIX
    Hello vashundara,
    please say which Version of Forte and which kind/version your UNIX OS is.
    There are some problems on AIX V4.3.x (Motif 2.x) and older releasese of
    Forte (up to Forte 3.M.x) and so on and it is necessary to look what it is.
    Maybe it is possible for you to say which widgets are the problem.
    Thanks forward
    Joseph Mirwald
    At 15:25 23.04.01 +0530, vasundhara wrote:
    Hi
    We are facing a strange problem when we try to port our application from NT
    to UNIX. The problem is that the GUI doesnt come properly. As per my
    knowledge gridding all the controls on the GUI shouldnot create this
    problem, but inspite of this we are facing it. Did anyone comeacross this
    situation?
    Thanks in advance
    Regards
    Vasundhara N.C
    Wisor Telecom Pvt Ltd
    Bangalore
    India

  • Problem with FNDLOAD upload command for Concurrent Program

    Hi Apps Gurus,
    I am facing a peculiar problem with the FNDLOAD command.
    My customer has a concurrent program which is running fine in Prod, and now they have requeseted for a change in the program, the change requested was to modify the parameters and the name of the program. I have done the changes and when I try migrating this change from DEV instance to IAT using FNDLOAD commands it is not getting migrated. There does not seem to be any problem with the LDT file, There is no error message in the log as well.
    However I have noticed something very peculiar.* In the target instance (IAT) , when i run the FNDLOAD command directly the migration is unsuccessful but when i delete the existing parameters of the prog and rename the concurrent program and then run the FNDLOAD command the migration is sucessful and the changes are getting reflected!!. I dont understand why this is happening. This is happening in preprod as well , the migration is unsucessfull initially when i directly run the command, when i modify the name and parameters of the prog and then run the command the migration is sucessful. Now i do not have access to prod and this trick of changing prog name and parameters cannot be done in prod , so I need a proper solution for the migration.
    Any pointers to resolve this issue will be helpful.
    Thanks,
    Mahesh

    I am facing a peculiar problem with the FNDLOAD command.
    My customer has a concurrent program which is running fine in Prod, and now they have requeseted for a change in the program, the change requested was to modify the parameters and the name of the program. I have done the changes and when I try migrating this change from DEV instance to IAT using FNDLOAD commands it is not getting migrated. There does not seem to be any problem with the LDT file, There is no error message in the log as well.
    However I have noticed something very peculiar.* In the target instance (IAT) , when i run the FNDLOAD command directly the migration is unsuccessful but when i delete the existing parameters of the prog and rename the concurrent program and then run the FNDLOAD command the migration is sucessful and the changes are getting reflected!!. I dont understand why this is happening. This is happening in preprod as well , the migration is unsucessfull initially when i directly run the command, when i modify the name and parameters of the prog and then run the command the migration is sucessful. Now i do not have access to prod and this trick of changing prog name and parameters cannot be done in prod , so I need a proper solution for the migration.
    Any pointers to resolve this issue will be helpful.What are the commands you used for the download/upload?
    Do you get any errors in the log files?
    Please see (FNDLOAD Download / Upload Concurrent Programs Fails To Load Parameters [ID 1101946.1]).
    Thanks,
    Hussein

  • Problem with Unix version of Reports

    When I run the report(filenam.rep) off of
    my P.C., it works fine. Then when I transfer
    it over to Unix and run the report, I get
    some of the values in my report copied into
    places they don't belong. For instance,
    I have a value for the last row and last column in my report that gets copied to the
    first value in the last column of every page
    except for the first page. The proper value
    doesn't appear and it gets replaced by this
    value instead. I am running Reports 2.5 on
    both my P.C. as well as Unix. My P.C. is
    an NT 4.0 workstation. My command line on Unix looks like this:
    r25runm report=${report} userid=reitprod/namrem batch=YES paramform=NO \
    buffers=1000 destype=file desname=${TEMP}.lis \
    ${PARAMETER_STRING}
    I also have Designer 6.0 installed on my P.C.
    I recently installed a patch to fix a problem
    with formatting in Reports 6.0. I am wondering whether the patch might have something to do with incompatibility between
    Reports 2.5 on my P.C. and Reports 2.5 on
    the Unix system.
    null

    Hello,
    We need more information in order to help. How are you requesting the report (command line, URL, ?). What file is it asking for?
    Regards,
    The Oracle Reports Team --skw
    null

  • Problem with Put Key Command

    Hi everyone
    I'm woking on Gem Xpresso card which support scp 02.
    I can Authenticate successfully and Install and load my applet on it. but I have problem in put key command.
    my first key set is:
    47454d5850524553534f53414d504c45
    and this is the key that I want to set as my new key:
    404142434445464748494a4b4c4d4e4f
    with the algorithm that I use the encrypt value of this key will be :
    33173C8ECDA55BDF7E50625531BE4FC5
    and its check value will be :
    8BAF47
    so this is the APDU that I send for Put Key command:
    80D800814301811033173C8ECDA55BDF7E50625531BE4FC5038BAF47811033173C8ECDA55BDF7E50625531BE4FC5038BAF47811033173C8ECDA55BDF7E50625531BE4FC5038BAF47
    but I recieve error 94 85 (invalid check value)
    do I calculate my check value wrong?
    does different versions of jcdk or different versions of globalplatform hav different ways for calculating check value and keys encrypted values?
    I'll appreciate any help
    Best Regards,
    Shilan

    Try visit Gemplus forum or mailing-list.

  • Problem with the dblink command

    I am working with the dblink command. i have connected to a remote machine which i have configured in my TNS names under the name 'miracle'. so now i have created a dblink to that m/c as:
    create database link data_link connect to scott identified by tiger using 'miracle';
    where scott/tiger is the schema on the remote machine.
    now i am accessing a table 'X' on the remote m/c as:
    select * from X@miracle;
    but i am getting an error saying:
    select * from x@miracle
    ERROR at line 1:
    ORA-02019: connection description for remote database not found
    somebody please help me.

    Also, is the source database (from where you are running the select statement), installed on the machine where you updated the tnsnames entry?
    If you change your local tnsnames it will not work. you need to change the tnsnames entry on the Orcle home where the database server is installed.

  • URGENT!! problems with Unix command, please help

    I am trying to use the following Unix command and I keep getting error messaages from stdError. However if I run the same command from the command line it works perfectly. For some reason when I run the command from inside the program it thinks the append symbol ">>" is another file.
    String command = " cat /users/02/wjoc1/Test/list.mod >> /users/02/wjoc1/Test/Blacklist ";
    Process p = Runtime.getRuntime().exec(command);
    The error get is :
    /bin/cat: >>: No such file or directory
    Any help would be greatly appreciated

    The better solution for this problem is write a shell script for the action you wnat to perform and execute it using the runtime.exec().In your case just cut and paste cat /users/02/wjoc1/Test/list.mod >> /users/02/wjoc1/Test/Blacklist in to a file and save it. use that file as a argument for the exec method it will work.
    cheers
    R.Karuna

  • Problem With UNIX command in ODI Environment.

    A procedure is used in our package which involves moving a file from a folder to another in a UNIX server.
    The procedure uses an OS command - 'os.system' to execute unix command.
    The unix command is a grep command which seems to work fine when executed alone.
    But when this procedure is executed ,it fails.
    The following code raises an error and the procedure fails.:
    if os.system(cmd) <> 0:
    raise "command fails","see agent output for details";
    Whenever we are trying to reverse,we get "file not Found " error.
    We tried to execute the jython code by placing the files in local directories. The same error appears both when the file is in local and when it is in a remote directory.
    This is the error we get:
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 20, in ?
    HeaderCmd failed:: See agent output for details      at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execSrcScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)      at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)

    Hi,
    The unix command is a grep command which seems to work fine when executed alone. :-
    I guess you executed this from your Unix server , so it work fines.
    And when you are trying to execute outside from this (using ODI) , its failing , right ?
    Can you please check the permission settings for that script file (sh).
    Please try by giveing the full permission (specifically execution permission) for all users connecting from other machines.
    This can be one of the reason for the failure .
    please let me know if this is not working
    Regards,
    Rathish

  • Problem with Miditech MTB-Command

    Hello,
    I've got a problem to configure correctly my Miditech MTB-Command; I use the "Mackie Control", but no transport buttons (Play, Stop, Rew, Rec, Fwd) are operative. Faders 1-8, pans 1-8 and solos work fine, but al 9-16 channels doesn't work. I use the lattest OSX in a Mac Pro.
    Anyone can help me?.
    Thank for all and greetings.

    UNIX/Linux systems expand wildcards onto the command line before invoking the
    individual commands. In effect, the shell rewrites the command line you give
    substituting the wildcard expansion. There is a limit to how long this command
    line can get.
    For example, suppose you have two files ("foo" and "bar") in your directory.
    The line:
    foreach name (*)
      echo $name
    endgets rewritten to:
    foreach name (foo bar)
      echo $name
    endand then the shell starts interpreting your script. So if you have many, many
    files, the rewritten line becomes:
    foreach name (f1 f2 f3 ... f10927)
      echo $name
    endso chances are the "foreach" line simply gets too long. To avoid problems do
    it this way; it avoids any problems based on how many files you have:
    ls | while read name
    do
      echo $name
    doneThis way the shell never exceeds its line length limitations because the
    wildcard is never expanded.
    Cheers

  • Problem with EL (forEach) in Facelets + JSF 1.2

    I am trying to upgrade my application from JSF 1.1 to JSF 1.2. However, I have run into a problem that I can't quite grasp.
    I have a backing bean with the following method
    public List<String> getFoos() {
    return foos;
    With JSF 1.1 + Facelets the following EL worked fine
         <c:forEach var="foo"
              items="${page.foos}">
              #{foo}
         </c:forEach>
    However, once I upgraded to JSF 1.2 suddenly this EL resolves to nothing. In fact, my getFoos() method on my backing bean is not even called. I have googled around but I cannot seem to find what changed in JSF 1.2 that would break this.
    If anyone has any ideas, your help is greatly appreciated.
    Thanks,
    Randy

    I have had problems using Java v8 with CUC. I had to go back to Java v7 to use the Media Master bar. Works fine now.
    If that doesn't work you could set up a Greetings Administrator call handler to record the greetings. You could even set up a hidden option to press * (or any digit) from your existing call handler to transfer to the Greetings Administrator call handler. Just need to set an owner for the call handler you want to record the greetings for (Edit/Call Handler Owner), then call the original call handler, press *, put in the username (VM extension), VM password and extension of the call handler you want to record.

  • Problem with SAPScript BOTTOM Command

    I have a SAPScript form with multiple paragraphs. In the original version I put a footnote at the bottom of a page by doing something like:
    >/E FOOT_NOTE                                                            
    >/: BOTTOM                                                               
    >B1 <NR><I0><HL><IT> Some fixed text.</>                                                 
    >/: ENDBOTTOM                                                            
    That worked correctly. Now I am changing the form so that a number of paragraphs may or may not appear at the bottom of the page. Since I donu2019t know which paragraph may be first, I tried creating two new paragraphs:
    >/E           START_BOTTOM
    >/:           BOTTOM
    >/*                                                                                  
    >/E           END_BOTTOM
    >/:           ENDBOTTOM
    I call START_BOTTOM, then conditionally call whatever paragraphs are needed and finally call END_BOTTOM.
    The problem is that the paragraphs simply continue on from the last line that was printed, not at the end of the page.
    (I had also tried putting:
    >/E           START_BOTTOM
    At the beginning of each paragraph that could appear at the end, and it worked to a point u2013 each paragraph appeared at the end, but overwrote whatever previous paragraphs were there.)
    Can anyone help me with controlling my BOTTOM?
    Thanks
    Rob

    Yes that's true, that Split in BOTTOM command doesn't work same as it works with the PROTECT.. ENDPROTECT.
    But, after some research I got success.
    Don't create any element in your MAIN window for BOTTOM / ENDBOTTOM. Use the FM WRITE_FORM_LINES to append entire BOTTOM .. ENDBOTTOM lines. Like:
    data: la_head like THEAD,
          lt_lines type standard table of TLINE,
          la_lines like line of lt_lines.
    select single * from stxh into la_head
      where TDOBJECT = 'FORM'
        and TDNAME   = 'ZTEST_WATERMARK'
        and TDID     = 'DEF'
        and TDSPRAS  = sy-langu.
    * Bottom Start
    la_lines-tdformat = '/:'.
    la_lines-TDLINE  = 'BOTTOM'.
    append la_lines to lt_lines.
    * Generic Text
    la_lines-tdformat = '*'.
    la_lines-TDLINE  = 'This is BOTTOM'.
    append la_lines to lt_lines.
    * Include Text1
    la_lines-tdformat = '/:'.
    concatenate '''' 'A1' '''' into la_lines-TDLINE.
    concatenate 'INCLUDE ZTEST_NP OBJECT TEXT ID ST PARAGRAPH '
      la_lines-TDLINE into la_lines-TDLINE separated by ' '.
    append la_lines to lt_lines.
    * Include Text1
    la_lines-tdformat = '/:'.
    concatenate '''' 'A1' '''' into la_lines-TDLINE.
    concatenate 'INCLUDE ZTEST_NP1 OBJECT TEXT ID ST PARAGRAPH '
      la_lines-TDLINE into la_lines-TDLINE separated by ' '.
    append la_lines to lt_lines.
    * Bottom End
    la_lines-tdformat = '/:'.
    la_lines-TDLINE  = 'ENDBOTTOM'.
    append la_lines to lt_lines.
    * Append lines to MAIN
    CALL FUNCTION 'WRITE_FORM_LINES'
      EXPORTING
        FUNCTION                       = 'APPEND'
        header                         = la_head
    *   TYPE                           = 'BODY'
        WINDOW                         = 'MAIN'
      tables
        lines                          = lt_lines
    EXCEPTIONS
       FUNCTION                       = 1
       TYPE                           = 2
       UNOPENED                       = 3
       UNSTARTED                      = 4
       WINDOW                         = 5
       BAD_PAGEFORMAT_FOR_PRINT       = 6
       SPOOL_ERROR                    = 7
       CODEPAGE                       = 8
       OTHERS                         = 9
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Naimesh Patel

  • Problem with COMMIT WORKS command

    Hello all,
    I’ve a little problem. It seams that I don’t understand how ‘commit work’ command works. When I’m calling transaction with USING parameter:
    CALL TRANSACTION 'FPSA' USING itab_bdcdata.
    When inside of that transaction ‘Commit works’ occur, than commit is being executed and transaction is ending which is not good, because there is still code left that should be executed.
    When I run transaction without USING
    CALL TRANSACTION 'FPSA'
    Everything works fine. I’ve tried using UPDATE addition in CALL FUNCTION, but without result. Does anybody know what is the problem?

    This is meant to work exactly as you described:
    A transaction called with CALL TRANSACTION USING returns right after COMMIT occurs - if you don't provide any additional options.
    There is a way to make such transaction continue with the code after the commit. You just have to use "OPTIONS FROM" addition of the "CALL TRANSACTION" statement - parameter RACOMMIT.
    For more information put the cursor on CALL TRANSACTION statement in your abap code and press F1.
    regards
    good luck

Maybe you are looking for

  • Camera Raw 6.3 update fails

    I receive an error message update failed when trying to run the Camera Raw 6.3 for PS CS5.  I am using an local administrator account, however it refers to contact my administrator.

  • Video resolution Problem

    The display that came with my Radeon HD 7600G will only support 1366 x 768, I get that.  o what I am trying to do is play some HD video ( 1920 x 1080 ) using an external monitor.  When I try to play a video of that resolution in the laptop display, i

  • My Ram suddenly not recognised ?

    Hi, I just did a MP2v encode session, I noticed my Intel Macpro 3ghz was having trouble with background programs while this encode was happening. so i waited till it finished and on checking my extra 4gig of ram does not show in sys profiler. I shutd

  • How Schema can be exported and imported in Oracle Apex?

    Hi, I am very new to oracle apex. I had installed Oracle XE database and apex successfully. I want to import an application to my apex. The application was created using workspace -Ver and Schema- Ves. I had imported the application and workspace int

  • Error in viewing the Workflow Diagram Applet thru Workflow Monitor

    Hi! I am receiving the following error while viewing the applet-based workflow diagram. IOException while fetching datajava.io.FileNotFoundException: http://172.16.24.1:7777/pls/wf/WF_MONITOR.GetProcess?x_item_type=NIS_WEB&x_item_key=6192&x_admin_mod