/dev/null changes result, why? ( How to know if svn repository exists )

Hi,
Because I am writing last few weeks some scripts for a project, I do want to put those under svn ( subversion ). As a scripting exercise I want to be able to create Repos and project folders in one go and add changes to the repo's svn conf files.
I want to check if there is already an existing repository and if the name=passw line is already added to the passw db.
I did use:
svnlook youngest /Volumes/Development/_svnRepo/SSHToolNew 2>&1 | grep "No such file or directory" -c
to check for the error message returned by svnlook
svnlook: Can't open file '/Volumes/Development/_svnRepo/SSHToolNew/format': No such file or directory
and want to continue doing my stuff when the result is bigger then 0, otherwise create the repo first with some options.
With the following info
/Volumes/Development/_svnRepo/SSHTools exists
/Volumes/Development/_svnRepo/SSHToolNew doesn't exists
using ( typed in the sh )
svnlook youngest /Volumes/Development/_svnRepo/SSHToolNew 2>&1 | grep "No such file or directory" -c
1
echo "rv:" $?
1
gives as result 1 in the shell and when using echo "rv:" $?
however
svnlook youngest /Volumes/Development/_svnRepo/SSHToolNew 2>&1 | grep "No such file or directory" -c &> /dev/null
echo "rv:" $?
0
gives 0 as result.
And when the folder do exists it return the opposite!?
Just to understands the happening. Why the difference with &> /dev/null ?
What do I mis here?

Hi Thanks you for your reply,
I want that the result goes into a var so that I can compare it in an 'if' statement.
If I leave & out then I get the following same result
bash-3.2$ svnlook youngest /Volumes/Development/_svnRepo/SSHToolNew 2>&1 | grep "No such file or directory" -c > /dev/null
bash-3.2$ echo "rv: "$?
rv: 0
It should be one ( 1 ) because the result count is one. Or am I wrong?
So basicly, why is it changing the result? or is $? not the result of my line?
What is the best way to check if f.e a command is failed like the one I use in an if statement? Can I move the result directly into a var, something like?
bash-3.2$ svnlook youngest /Volumes/Development/_svnRepo/SSHToolNew 2>&1 | grep "No such file or directory" -c | MyVar=$? ( or whatever needed )
Thanks again

Similar Messages

  • How to know if a file exists before uploading or downloading

    Is there FM to know it a file exists or not before doing anything with it?
    thanks

    Hi,
           use call function GUI_upload if file present
          sy-subrc  will be 0 ELSE fm RESULTS IN ERROR
         ALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename                = filename
                filetype                = 'ASC'
           TABLES
                data_tab                = cofdata
           EXCEPTIONS
                file_open_error         = 1
                file_read_error         = 2
                no_batch                = 3
                gui_refuse_filetransfer = 4
                invalid_type            = 5
                no_authority            = 6
                unknown_error           = 7
                bad_data_format         = 8
                header_not_allowed      = 9
                separator_not_allowed   = 10
                header_too_long         = 11
                unknown_dp_error        = 12
                access_denied           = 13
                dp_out_of_memory        = 14
                disk_full               = 15
                dp_timeout              = 16
                OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE i110 WITH sy-subrc 'cofile' filename.
        EXIT.
      ENDIF.
    Regards
    amole

  • How to know if a canvas exists in a form

    I use a reference form and a template as the base of all my forms. There is some code I'd like to put in my reference form which does one thing or another depending upon whether or not a certain canvas exists in a form. Is there some way for me to know programmatically what canvases exist in a form? Or whether a certain canvas exists?
    Thanks,
    Meg Colby

    Hi Meg,
    try this:
    DECLARE
    my_canvas Canvas;
    BEGIN
    my_canvas := Find_Canvas('my_canvas');
    IF NOT ID_NULL(v_id) THEN -- canvas exists
    ELSE -- no such canvas
    END IF;
    END;
    Monica

  • Text Format size not changing results -- why?

    Seems like this should be pretty straight forward, and I must have done this many times before with success.  Am I missing something obvious?
    The text shows up, but it needs to display bigger than it is.  It's showing up consistently at about size 10, no matter what I set the size to, even "size = 100" ...
    public function StimLetter(data:Object) {
                   // format
                   var format:TextFormat = new TextFormat();
                   format.font = "Verdana";
                   format.color = 0x000000;
                   format.size = 100;
                   // text
                   stimText = new TextField();
                   stimText.text = data.strng;
                   stimText.autoSize = TextFieldAutoSize.CENTER;
                   stimText.defaultTextFormat = format;
                   addChild(stimText);
    data.strng is simply a String coming from an array. 
    Am I missing something here?! 

    perhaps it's relevant to mention that the code above is the bulk of a "StimLetter" class that is importing into another class, and processed this way:
    public var letterArray:Array = ["B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N","P", "Q", "R", "S", "T", "U", "V", "X", "Z"];
    // lots more code ...
    var stimID:int;
    var strng:String;
    for (var si=0 ; si < letterArray.length; si++) {
         stimID = si + 1;
         strng = letterArray[si];
         this["stimLetter"+stimID] = new StimLetter({stimID: stimID, strng: strng});
         this["stimLetter"+stimID].x = displayCenter.x;
         this["stimLetter"+stimID].y = displayCenter.y;
         stimArray.push(this["stimLetter"+stimID]);
         container.addChild(stimArray[si]);

  • How to know if a element exists?

    Hi!, I have an Flex 4 proyect, and in the .mxml file I have something like this:
    <s:BorderContainer id="PCDock"  ....
    By code, fired by an event, I remove that element with:
    removeElement(PCDock);
    and can add it to stage with:
    addElement(PCDock);
    but, how can I know if my element "PCDock" exists in the stage?
    Thanks!

    Hi RaúlKirm,
    Here this  refers to main application.
    If you have placed PCDock directly in your <s:Application /> container then you can use this.getElementIndex(PCDock), but if you have placed in another container then it will throw an error since it doesn't belong to Application directly but a subchild of it.
    Say if your BorderContainer  is in another conatiner as something below then you need to use as shown below:
    <s:SomeContainer id="PCDockConatiner">
         <s:BorderContainer id="PCDock"  ....
    </s:SomeContainer>
    So here you need to use PCDockConatiner.getElementIndex(PCDock) instead of this.getElementIndex(PCDock) since PCDock  is not the direct child of Application container but of PCDockConatiner.
    if (PCDockConatiner.getElementIndex(PCDock)<0){
            addElement(PCDock);
    Thanks,
    Bhasker

  • How to know if a element exists in XML

    I need to know if a particular tag name is present in the XML or not.Which method of DOM api I should implement?

    NodeList elems = doc.getElementsByTagName("whateverTagName");

  • How to check odi master repository exist in oracle database?

    Is there way to check the ODI master repository is exist in oracle database or any api to test that?
    Your help much appreciated.

    Thanks for you reply,
    That's fine, i think you aware of that, once open the topology manager "topology.bat", you can test the master repository, if you give any existing database user but its not master rep user, that throw exception "Master repository is not installed on this connection".
    I want know what are tables and data's are getting verified during the connection test.
    I think If you know regarding above my question, that will solve my problem.
    Thanks

  • /dev/null file permission changes frequently

    Hi,
    We are experiencing file permission change issue frequently for the
    following files:
    root@domain5 # ls -l /devices/pseudo/mm@0:null
    crw-rw-rw- 1 root sys 13, 2 Apr 22 2009
    /devices/pseudo/mm@0:null
    root@domain5 # ls -l /dev/null
    crw-rw-rw- 1 root sys 13, 2 Oct 25 07:01 /dev/null
    By default, above is the file permission settings. If the file permission
    changes, it will look like as below:
    root@domain5 # ls -l /devices/pseudo/mm@0:null
    cr--r--r-- 1 root sys 13, 2 Apr 22 2009
    /devices/pseudo/mm@0:null
    root@domain5 # ls -l /dev/null
    cr--r--r-- 1 root sys 13, 2 Oct 25 07:01 /dev/null
    Due to this file permission change the script which uses this file loose
    the write permission and the script fails. To fix this issue, we will be
    manually changing the permission. Can you please help me to know the cause for
    this file permission change.
    Thanks,
    Ram.

    You need to correlate any changes on the system to when you have the problem, or see the date on /dev/null change. Software packages can change this, applications can change this, sometimes even patch installs.
    Even certain administrative practices.
    Here's one example, where touching a vendor software-created printer config with native Solaris admintool would change /dev/null permissions
    http://www.rootunix.org/SOLARIS/printFAQ.txt
    10) ONLY ROOT CAN SEND PRINT JOBS:
    This problem is caused by network spooling software that for a
    network printer that uses /dev/null for the printer device. The
    software monitors the queue and spools the print requests over the
    network to the printer. If the printer setup is modified in any
    way with Admintool, the printer device (/dev/null) permissions will
    change to 600 owner lp.

  • How to know whether any item value got changed

    How to know in Apex whether any form item got changed. That will help me to know when the user will be pressing the "Apply Changes" button and I will popuplate the "User Modifed" and "Date Modifed" column values in the table. For now, I dont want to write database triggers, but to implement it at application level.

    Hi Deb
    For a really good explanation of the naming /numbering of tabular form items see Patrick Wolf's blog on the matter.
    http://www.inside-oracle-apex.com/which-tabular-form-column-is-mapped-to-which-apex_applicationg_fxx-array/
    He also gives a simple example of using check-boxes in tabular forms here
    http://www.inside-oracle-apex.com/checkboxes-in-tabular-forms-the-easy-way/
    You will notice in his example, that the apex_application.g_f40 is specifically named as 40 - a high number assuming that you don't have more than 39 editable columns in you tabular form - shown in the name="f40" code.
    <input type="checkbox" #ADMIN_USER_CHECKBOX# value="#ROWNUM#" name="f40" id="f40_#ROWNUM#"/>#ADMIN_USER_CHECKBOX#
    In essence the columns are numbered (only the editable ones) in the order in which they appear in the select statement - so the first editable column will be f(01), next f(02) etc - except where the column is specifically named - in this case f(40).
    I had a situation where I wanted to programatically stamp the user's name into a column depending on whether the user checked a check-box in each row.
    But if the column is editable and visible, then the user is free to type into this cell - this I wanted to avoid.
    Something that took me a while to work out is that you can hide an editable column - so it can updated by your procedure code - not by the user!
    The way to solve this is to have the sql statement select the relevant column twice - the first one is the editable one and hidden, and the second copy is a normal report column - displayed but not editable.
    I used Patrick's example in the link above to set up my tabular form with the first column as a check-box.
    The user then marks the desired rows by clicking in the check-box and submits / saves.
    The procedure then detects which rows have been checked - updates the editable (but hidden) database column, and then re-displays the result - with the second copy of the same column now showing the updated value!
    I hope this helps.
    Look at Patrick's other postings - they are so helpful.
    Mike

  • How to know whether there is any change in a transaction in ic webclient

    Hi,
    There is one activity screen in the ic web(CRM 5.0). There is two button(Change, Save , Sendnotification) on that screen.
    Sendnotification: if i click this button then it will check whether there is any change done using  below logic and will send the noti..:
    DATA:lv_transaction   TYPE REF TO if_bol_transaction_context,
    lv_entity       TYPE REF TO cl_crm_bol_entity.
    lv_transaction = lv_btorder->get_transaction( ).
          IF lv_transaction->check_save_needed( ) EQ 'X'.
             then save the changes  and send notification
          ENDIF.
    Question:
    Now i clicked on the Change button and did some changes.Then saved.
    Then again i did some changes, now i clicked on the Sendnotification button.It sent an notification.
    Now i again clicked on the Sendnotification(this time i didnt do any changes), it sent the same notification again.
    So how to know that  actully changes done or not & how to write code if there is no changes?
    During debugging , i found that the method check_save_needed always returns 'X' as long as i am in the chage mode of that activity. As a result if i dont do any changes also in the activity and click the button , it sends the notification.
    please suggest how to restrict  using coding........
    Thanks
    sudhansu

    Not solved.

  • How to change passcode when you dont know it

    Hi there i have changed my passcode but you know when you use fingerprint recognition at all times and than you battery died on you when you started up you have to put passcode in and that is where my problem began. Can somebody tell me how to reset passcode  plz.

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    A
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    7. iOS - Unable to update or restore
    Forgotten Restrictions Passcode Help
                iPad,iPod,iPod Touch Recovery Mode
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    You can restore from a backup if you have one from BEFORE you set the restrictions passcode.
    Also, see iTunes- Restoring iOS software.

  • How can I see the whole screen on my original iPad, without having to scroll up or down.  Something changed and I don't know how to get it back.  I don't have a computer to hook it up to.  Thx!

    My front screen seems to zoom in when I start it now.  AND, now I can not see the page fit the screen.  It makes me scroll on the borders to move parts of the screen into view.  Something changed and I don't know what happened or how to get it back to normal.  Please HELP!!!  Thx!

    it is possible that zoom maybe enabled i think double taping with three fingers should disable it.
    or you can go into settings>general> assessability> zoom and turn it off.
    hope this helps

  • No matter how many times I start itunes on my pc I have to agree to the terms of service gain and when it does open my settings have all been changed.  why is it doing this and how can I satop it?  reinstalling does not fix it.

    No matter how many times I start itunes on my pc I have to agree to the terms of service again and when it does open my settings have all been changed.  Why is it doing this and how can I stop it?  Reinstalling/repairing does not fix it.

    McAfee AntiVirus by any chance? See the thread Why does iTunes delete my itunesprefs.xml?
    Or it could be an issue with the SC Info folder. See TS1277 - iTunes: Missing folder or incorrect permissions may prevent authorization for details.
    Or a repair install of iTunes from the Programs and Features control panel might fix the problem.
    tt2

  • Sometimes Apple sends emails to me in Dutch.  My language is English.  An Apple employee told me my initiating profile shows Dutch.  He did not know how to change it.  How do I?

    Apple sends emails to me in Dutch to one of my email addresses.  My language is English.  An Apple employee told me my initiating profile shows Dutch.  He did not know how to change it. How do I? 
    (Note:  When I bought my first Apple product, I used a Shaw email address.  This year I changed my primary email address to a gmail one.  The gmail one is apparently on my Apple profile.  Nonetheless, the Dutch messages go to my Shaw email address.)
    Thanks!
    ruthrr

    Hi, ruthrr.
    This sounds like your language preference is set to Dutch on your Apple ID.  I would go to My Apple ID, Manage Your Apple ID and change the language and contact preferences. 
    Cheers,
    Jason H. 

  • How to know when the PRICE AFTER DISCOUNT changed and get the value

    Hi,
    Everything I do to see if a value changed in the grid works except for PRICE AFTER DISCOUNT
    which seems to be inaccessible.
    Any idea how to know when exactly this value changed and do actions accordinly ?
    Also I always get 0.00 if I try to get the value of it
    This works to get in the condition of a vlaue changing but I always get 0.00 as the value of the column
    if (pVal.ItemUID == "38" && pVal.ColUID == COL_DISCOUNT.ToString() && pVal.EventType == BoEventTypes.et_VALIDATE && pVal.ItemChanged == true && pVal.ActionSuccess == true)
        try
            SAPbouiCOM.Matrix Matrix = (SAPbouiCOM.Matrix)SBO_Application.Forms.ActiveForm.Items.Item("38").Specific;
            SAPbouiCOM.EditText Editor = (SAPbouiCOM.EditText)Matrix.Columns.Item(COL_DISCOUNT).Cells.Item(pVal.Row).Specific;
            SBO_Application.MessageBox("Discount changed for : " + Editor.Value + "...", 1, "Ok", "", "");
        catch (Exception ex)
            SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
    And this do not even get into the condition even tought I SEE the column PRICE AFTER DISCOUNT:
    if (pVal.ItemUID == "38" && pVal.ColUID == COL_PRICEAFTERDISCOUNT.ToString() && pVal.EventType == BoEventTypes.et_VALIDATE && pVal.ItemChanged == true && pVal.ActionSuccess == true)
        try
            SAPbouiCOM.Matrix Matrix = (SAPbouiCOM.Matrix)SBO_Application.Forms.ActiveForm.Items.Item("38").Specific;
            SAPbouiCOM.EditText Editor = (SAPbouiCOM.EditText)Matrix.Columns.Item(COL_PRICEAFTERDISCOUNT).Cells.Item(pVal.Row).Specific;
            SBO_Application.MessageBox("Price after discount changed for : " + Editor.Value + "...", 1, "Ok", "", "");
         catch (Exception ex)
             SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");

    just idea, maybe it will works
    Create one udf in row level and set there FS based on changes on price after discount and fill value what is in price after discount. Then the validation make on this field instead of standard SAP field.

Maybe you are looking for

  • Upgrade from 10.1 to 10.4

    I have a 2001 Powerbook G4(Gigabit Ethernet),550 MHz. 1GB memory. 20GB HD. It was upgraded from OS 9 to OS 10.1 years ago. I am thinking about upgrading it to 10.4 Tiger. Is it possible since my Mac is an old one? Is it worth the money? If I decide t

  • How to search for password policy

    Hello, Using DS 5.2: I've created a test policy, dn: cn=Test Policy,ou=People, o=xxx, o=isp. I can apply the policy, I can see the policy in my backup ldifs, but I can't figure out how to search for and display it (and eventually, delete it) either f

  • Blocking Ads in IE11

    Hi, I am a Google chrome user and I want to switch into IE11 on Windows 8.1. But the problem is that I did not found anyway to block advertissements in IE. Please, is there any extension or way to do so ? Thank you.

  • Transaction management in App module

    Hi - I have a scenario where my db operation needs to participate in the distributed transaction. This operation will be called by a SOA service. So, i have created a custom class and custom method in my application module and exposed that as service

  • My minimize button is black instead of colored

    I have a 15" Macbook Pro Retina and for some reason my close/minimize/maximize buttons are black instead of red/yellow/green.. I tried to look through the setup but could not find anything to change these.. Where is this setup? Thanks Gary