Special characters in shell script

I'd like to run the following one line shell script which brings up the login window.
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
this works form the terminal but I want to do it inside apple script using
"do shell script".
I know that I need to use some form of quoting because the path contains a special symbol (namely "space" inside "Menu Extras").
How do I do that?
Sorry for a completely newbie question. I know this is something obvious but I'm just trying out scripting.

You need to escape the escape character "\" itself by putting another in front.
Unfortunately, the discussions system is preventing me from showing it here as it's interpreting the double escape into the space character.
Message was edited by: Bernard Harte

Similar Messages

  • How to print Special Characters in Sap-Scripts

    How to print Special Characters in Sap-Scripts
    Thanks,
    Ravi

    Hi
    if u want print special characters we can use hot codes i.e '  '  (single inverted commas). in between these hot codes insert u r special characters.
    write    '    !@#$%^&*( )  '.
    for the above write statement output is
    output is   !@#$%^&*( )

  • Need to add special characters in sap scripts

    Hi All,
       I need to add special characters in sap script.
    I have used them as it is my script,but in the print preview i am able to see '#' instead of those special characters.Can anybody please tell me the way in which we can add special characters in the scripts.
    eg. 'Shlesha' i.e. name in inverted colons.
    Thanks

    Hi
    If # is coming means, that is the problem with the printer. I think u might have used your local printer to see the print preview.
    Don't use LOCL or LP01. Our local printer won't recognize those characters.
    Just change the printer name to client printer name. It will work.

  • Special Characters printing In Scripts

    HI Frnds,
          I want to print special characters in scripts
    č
    ě
    ř
    Č
    ů
    í
    ů
    the characters are like this , how can i write the characters in Text elements window of scripts , if i am trying it is giving question marks, it should in the output also, hw can I do it.
    reply

    Hi,
    Copy the text from a word document and paste it in the text element..instead of typing it..
    Then I believe you should get it
    Thanks
    Naren

  • Unable to print special characters in SAP script.

    Hi,
      There is an address which needs to be hardcoded in a SAP Script form.
    It looks like:
    Česká republika s.r.o
    Karla Engliu0161e 3219/4
    Česká republika
    IČO:  25635972
    The letters which has got a tilde and sign above them are appearing as a hash '#' in print. I have tried uploading it as an image and as standard text. But still not working. Can someone help please?
    Thanks in advance,
    Anita

    Hi Anita,
    Please search in SDN,, similar issues were answered before many times...
    Regards,
    Aditya

  • Designating literal characters in "do shell script"

    (Also posted in UNIX forum)
    If, in Terminal, I do this:
    echo 1/2/3 | sed 's/\/2\// and /g'
    I get the expected result, which is:
    1 and 3
    But if, in AS, I do this:
    do shell script "echo 1/2/3 | sed 's/\/2\// and /g'"
    I get this error message:
    Expected “"” but found unknown token.
    If I change the AS command to:
    do shell script "echo 1/2/3 | sed 's//2/ and /g'"
    I get this error message:
    sed: 1: "s//2// and /g": bad flag in substitute command: '/'
    (Of course, if I change the AS command to:
    do shell script "echo 1/2/3 | sed 's/2/ and /g'"
    I get the expected result, which is:
    1/ and /3
    but this is no help in getting rid of the forward slashes, which is what I want.)
    I think this also happens with some other "special" characters surrounding "2". A Google search would seem to indicate this as a well-known dilemma, but I haven't stumbled across a clear solution -- is there one?

    osimp,
    I also replied in the Unix forum. But here's a little more explanation.
    Your command string gets "evaluated" twice... first by AppleScript and then by the shell. Since backslash characters are escape characters in both AppleScript and the shell, you want literal backslashes passed from AppleScript to the shell so when the shell gets the command string it will process them as escape characters in front of the forward slashes.
    So you need to escape the backslashes (double-backslash) in AppleScript so they'll be passed to the shell as literal backslashes (single-backslash). Then when the shell evaluates the string the single-backslashes will be treated as escape characters.
    <pre>
    do shell script "echo 1/2/3 | sed 's/\\/2\\// and /g'"
    </pre>
    Steve

  • How to display special characters in Script...

    hi all,
    Can any one tell me how to display special characters in script...
    how to write in text element
    thanks in advance,
    prashant

    Hi Prashant ,
      What special characters would you like to include .
    There are a set of characters / icons /symbols that can be included in Script , for that open a window in edit mode and in the menu there will be an option called Insert  , here you can find a lot of characters/symbols that can be included .
    Regards,
    Arun

  • Write Special Characters in PDF file from SAP Script

    Hi there,
    Need a quick help...
    We are converting SAP Script to PDF using the function module CONVERT_OTF
    and saving the file on presentation server using GUI_DOWNLOAD...
    But in certain cases where the item text is maintained with some special
    characters like @#$% u03B1 u03B2 u03B3 u03B4 ®... then, some of these characters are seen
    as junk/garbage characters...
    how do we handle this??
    P.S. Our Forms are already using Korean Font...
    Any help is highly appreciated
    Kind Regards,
    Tanuja

    Hi,
    Use the FM  CONVERT_OTF to get the Binary data and  down load it as PDF .
    sample
    */ Convert the OTF data into PDF.
        call function 'CONVERT_OTF'
         exporting
           format                      = 'PDF'
         importing
           bin_filesize                = lv_bin_filesize
            bin_file                   = lv_xstring
          tables
            otf                        = lt_otf_data-otfdata[]
            lines                      = lt_pdf_data
         exceptions
           err_max_linewidth           = 1
           err_format                  = 2
           err_conv_not_possible       = 3
           err_bad_otf                 = 4
           others                      = 5  .
    */ Convert the Xstring data into PDF
        call method cl_document_bcs=>xstring_to_solix
          exporting
            ip_xstring = lv_xstring
          receiving
            rt_solix   = lt_mess_att .
    Then down load the table lt_mess_att  with extension PDF.
    Edited by: UmaMaheswaraRao Surapaneni on Apr 1, 2009 5:44 PM

  • Shell Script -french characters are converting to junk in PLSQL

    Hi All,
    I have plsql package. I have included few french word in it for validation purpose.
    When i compile this package from SQL Developr it is compiling properly.
    but when i run shell script from putty and try to comppile this package the package is errorring out.
    The reason for error out is it is converting few french characters into some junk characters. is there any setting for this.?
    Thanks
    Bharat

    Bharat wrote:
    Hi All,
    I have plsql package. I have included few french word in it for validation purpose.
    When i compile this package from SQL Developr it is compiling properly.
    but when i run shell script from putty and try to comppile this package the package is errorring out.
    The reason for error out is it is converting few french characters into some junk characters. is there any setting for this.?
    Thanks
    BharatYour problems are in the are called globalization ( was called NLS)
    This can cause many problems, and is it extremely common for systems/applications/databases not be set up properly.
    Your script in SQLDeveloper is probably being held in the UTF8 characterset .... though I emphasize probably, and your file is probably saved as such.
    The oracle database, in whatever characterset that is in, let us call it CHARSET-DB, has however probably determined your sqlplus client is running a different characterset CHARSET-CLI and will perform a conversion from CHARSET-CLI to CHARSET-DB.
    Obviously if the Oracle Database has been led to falsely identify CHARSET-CLI then unwanted conversions can take place, however usually most (all?) charactersets are the same for most/all of 7-bit ASCII characters, so it is only things outside this that get affected. e.g. £, é, ó and lots of others.
    From a linux viewpoint the locale command and "LC*" variables may exert influence. However from an Oracle Client perspective the NLS_LANG variable is more effective.
    I suspect setting your NLS_LANG to UTF8 (e.g. NLS_LANG=AMERICAN_AMERICA.UTF8 ) and locale to US.UTF-8 or similar is likely to solve your issue.
    See below for a good document from OTN and a more specialist forum for this problem ( though there are some you use this forum who may be able to help you as well)
    http://www.oracle.com/technetwork/database/globalization/nls-lang-099431.html
    {forum:id=50}

  • Using devanagari script in the 'special characters' option in Pages

    Using the special characters menu in Pages how can I produce double consonances?  Any help would be gratefully received

    That should be double consonants if you have been searching.
    What keyboard are you using?
    Devanāgarī Typing & Keyboard Layouts (Mac & Windows)
    http://www.indiantypefoundry.com/help/technical-issues/devanagari-keyboard/
    https://discussions.apple.com/thread/3548952?start=0&tstart=0
    Peter

  • Terminal vs "do shell script" - different behaviour processing extended characters

    Åäö won't be processed correctly by shell command "tr" when triggered by AppleScript.
    Result from Terminal (running shell "sh"):
    sh-3.2$ echo "ABCabcÅÄÖåäö" | tr "[:lower:]" "[:upper:]";
    Result: ABCABCÅÄÖÅÄÖ
    sh-3.2$ echo "ABCabcÅÄÖåäö" | tr "[:upper:]" "[:lower:]";
    Result: abcabcåäöåäö
    Result when running AppleScript "do shell script" (natively using shell "sh"):
    do shell script ("echo \"ABCabcÅÄÖåäö\" | tr \"[:lower:]\" \"[:upper:]\";")
    Result: ABCABCÅÄÖåäö
    do shell script ("echo \"ABCabcÅÄÖåäö\" | tr \"[:upper:]\" \"[:lower:]\";")
    Result: abcabcÅÄÖåäö
    I also tried a tip from another discussion - "/bin/echo" or "prinf" instead of just "echo".
    - Same result.
    Any suggestions how to overcome this?
    /Martin

    Hmm, thought you solved my problem but, sigh!, it seems the German Capital ß is a problem.
    More of a linguistic problem though so, thanks a lot anyway!
    http://en.wikipedia.org/wiki/Capital_ß
    Lowercase => uppercase
    Original lowercase
    abcdefghijklmnopqrstuvwxyzßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿþœšÿ
    Uppercase result using sh & tr in Terminal
    ABCDEFGHIJKLMNOPQRSTUVWXYZßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝŸÞŒŠŸ
    Uppercase result using perl via applescript
    ABCDEFGHIJKLMNOPQRSTUVWXYZSSÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝŸÞŒŠŸ
    Difference: Lowercase ß => ß using sh but => SS using perl.
    Uppercase => lowercase
    Original uppercase
    ABCDEFGHIJKLMNOPQRSTUVWXYZßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝŸÞŒŠŸ
    Lowercase result using sh & tr in Terminal
    abcdefghijklmnopqrstuvwxyzßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿþœšÿ
    Lowercase result using perl via applescript
    abcdefghijklmnopqrstuvwxyzßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿþœšÿ
    Difference: None.

  • Passing Null Characters from Unix Shell Script to Java Program

    Hi Experts,
    Facing an issue with a shell script....
    The shell script has 10 input parameters....
    1st Parameter is a compiled Java program name(This can keep changing)
    Rest 9 are the parameters of the Java Program...
    The following piece of code is working when Test "a z" "b t" "" "" "" "" "" "" "" "" is hardcoded.
    lv_java_string=`java Test "a z" "b t" "" "" "" "" "" "" "" ""`
    The whole thing being dynamic.....
    But when I dynamically populate the same on to a parameter lv_java_param and then execute the same
    lv_java_string=`java $lv_java_param`
    if i echo $lv_java_param  its giving me Test "a z" "b t" "" "" "" "" "" "" "" ""  correctly
    Im facing some issue...... The issue is " is being treated as a parameter itself and the space between a and z is not taken into consideration and hence z is taken as the 2nd parameter
    Issue seems to be something like the precedence in which the above statement is executed, because of which "s are calculated/manipulated. Is it something like
    a) $lv_java_param is computed  first and then java $lv_java_param
    b) or java $lv_java_param is run on the fly......
    Any help is much appreciated.

    This forum is about Oracle *RDBMS*
    I don't see any question about Oracle RDBMS
    Please find a forum about Java.
    Sybrand Bakker
    Senior Oracle DBA

  • Handle special characters in SQLPLUSW window.

    Dear SQL Gurus,
    In my organisation every day we receive some data changes from developers and we need to do those changes in all databases. I developed a shell script to automate this procedure. but the problem I am facing problem with special characters like TM(trade mark), (R) - reserved character.
    To store these values in the database our team members are using TOAD for insert operations. If I execute the same statemenst from SQL prompt I am not able to store the special characters in database.
    we are using 10.2.0.4 version on sun solaris10. Please help me in this.
    Thanks,
    KPS

    Dear Saubhik,
    please let me know the procedure to insert the special character from SQL prompt. You explained about how to retrive from database using select statement. It is really good. our developers give the insert statements in word documents. so that they can place the special characters.
    Thanks,
    KPS

  • Can you help me find my special characters?

    I have used special characters without any hitch in the past. But now I can't bring them up at all.  Not in Pages, or in Mail.  Can anyone suggest a solution?  I'm using a rather old 12"  iBook G4.

    Tom Gewecke wrote:
    Dewi Gregory wrote:
    Don't do this if you don't want to lose everything on your desktop
    That's strange!  This was a very common problem and fix several years ago when 10.5 came out and I don't remember hearing of anyone losing anything.
    Me too Tom
    But it's easy to get odd behavior with the terminal. One added letter or a dropped one may make a huge difference.
    It's why I encapsulate calls to terminal in a Do Shell Script  instruction.
    This may I may easily triple check it before execution.
    Yvan KOENIG (VALLAURIS, France) mercredi 20 juillet 2011 16:17:51
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Perl's __END__ doesn't work under Automator's Run Shell Script action

    Howdy,
    I have a large embedded data file in my Perl source file using the _END_ token. It works great at the command line, but when I copy and paste my Perl code into the Run Shell Script code window and execute it, reading the special file handle DATA always returns 0 lines.
    Help?
    -Eric

    Originally I was using $@ to parse a string and get the result pasted by the service. That was a while ago. There, I noticed that some Japanese characters were messed up. Basically all the kana characters that come with voicing markers like が-ga (instead of か-ka) etc. I did not have the time to pursue that issue though.
    Then, last night, I found that a colleague of mine had tried to use $@ to feed to a local dictionary application called ding (http://ftp.tu-chemnitz.de/pub/Local/urz/ding/). His problem was with characters that had umlauts. After verifying how he wrote his action I remembered that I had similar issues with Japanese.
    Basically his command was "/path/to/ding $@"
    That's supposed to use the selected string as an argument to pass to ding, which will launch a Wish application where the string is used as the searched item.
    From Terminal, that works a treat. But the exact same line in Automator (with input as argument, not as stdin) messed the composition and the resulting string was not recognized by ding as a match to what it was supposed to match.
    So, I tried a few things to get to the core of the issue and found that a simple "echo [accented characters]" was enough to reproduce the difference in string handling between Automator and Terminal. That difference is also reproduced on a number of person's machines.
    I have a number of services that basically revolve on "run shell script" actions and involve 3rd party application outputs, preference files etc. so it would not be convenient to show that to you.
    I have sent a mail about this issue to the automator list yesterday too:
    http://lists.apple.com/archives/Automator-users/2011/Jun/msg00004.html

Maybe you are looking for

  • Apache pdf file permission issues

    I have a intranet site that I need to publish some pdf files. I am using a G5, Leopard and apache 2 and PHP. My PHP is just providing a link the pdf documents, but when a user clicks on the link they get a message "You don't have permission to access

  • Quick Time + Itunes Not working

    I upgraded my itunes to the new 6.0 version,And now It wont open. Ive tried to reinstall itunes again but still it wont work. Next i tried to open QuickTime and it only opens for 2 seconds and then closes. I think thats the problem,But i dont know ho

  • How to Publish User ID & User Name in WAD

    Hi Guru's I am working on WAD 3.x ,please suggest me below things 1. How to Publish User ID & User Name  in WAD, these       are Text Webitem or any other Lables. 2. How to provide Save & Print functionality in WAD. Regards Reddy

  • Download of 9iAS 9.0.3 Broken

    I'm trying to download, but I'm not getting past the export restriction screen. I click all the boxes and press agree and I get sent right back to that screen. I'm logged in and accepting all cookies. Is there something wrong with this page?

  • Customer self service form gives the error of  "Page cannot be displayed"

    Hi All, Customer self service form from Navigation: Recievables -> Customers --> Standard gives the error of "Page cannot be displayed" but the same form gets opened when i navigate that from Order Management responsibility Thanks&Regards, APPS DBA