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

Similar Messages

  • 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

  • When I print a document with Arabic script in In Design the characters appear in an inverted form, in the opposite direction, while the printer doesn't do this with other software such as Word

    When I print a document with Arabic script in In Design the characters appear in an inverted form, in the opposite direction, while the printer doesn't do this with other software such as Word

    (The small field at the top of questions is to type just a title; the large field is to type your full question in, along with anything else that may help us help you.)
    When you say "print", do you mean the text is correct in your InDesign file? If you export the document to a PDF, is it still correct? Final test: if you print the PDF to your printer (making sure you use the same driver and setting), is it wrong? Then it's your printer driver, trying to be smart when it should not. Locate a Settings dialog where you can switch off options such as this one. Were I a betting person, I'd tell you to look for something called "Auto-correct mirrored documents".

  • 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}

  • 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

  • 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.

  • Do shell script problem in Applescript

    Hi,
    I am an Applescript novice and have been trying to write a code to go to a particular folder, look for all files in the folder tree with extension .m2v and run an executable file to decode them. My problem is that when I run my code (containing do shell script), it searches through all files and folders on Mac HD and starts decoding .m2v files elsewhere that I don't want.
    Eventually it runs out of space (.m2v file decoding takes a lot of space), because it is dumping all decoded .yuv files onto the HD.
    When I run the command on Terminal, it executes the decoding perfectly and stores the decoded files in the same folder.
    Please help me about what's going on.
    My code is something like:
    tell application "Finder"
    set DestinationFolder to "xxxxxx:xxxx:xxxx"
    set NumFolders to (get count of folders under Destination folder)
    repeat for SomeVar from 1 to NumFolders
    set FolderinQuestion to folder SomeVar of DestinationFolder
    -- Tried tell application "Terminal" here, but did not know --how to export the FolderinQuestion variable from Finder to --Terminal
    do shell script " \" cd \" & (POSIX path of (result as text));
    for file in `find $pwd \"*.mov\"`
    do
    /usr/local/bin/decode file
    done"
    end repeat
    end tell
    I would greatly appreciate some guidance.

    The root of the problem is that you're trying to quote the cd command for some reason:
    <pre class=command>do shell script " \" cd \" & (POSIX path of (result as text));
    ...</pre>
    In addition to that you're including the & (POSIX path of (result as text)) as part of the shell command whereas this should be OUTSIDE of the quotes in order to get evaluated
    If you work that through you'll end up with a shell command that looks like:
    <pre class=command>" cd " & (POSIX path of (result as text))</pre>
    If you try to run that in a terminal you'll get a cd : command not found error and that's why the rest of it appears to fail.
    The solution to that one is simple - just don't bother quoting the cd and put the POSIX path stuff outside of the quotes to get it evaluated at runtime:
    <pre class=command>do shell script "cd " & quoted form of POSIX path of (FolderInQuestion as text)) & ";
    # rest of shell commands here"</pre>
    Now, as for the rest of the script there are a few things I would change.
    First, unless you need to know the index, don't do:
    >repeat for SomeVar from 1 to NumFolders
    set FolderinQuestion to folder SomeVar of DestinationFolder
    the issue is that the number of folders to process may change during the script's execution (other processes may create or remove folders). This will, at best, cause some folders to be skipped and, at worst, cause the script to fail.
    If you're iterating through a list, the best option is to just:
    <pre class=command>repeat with FolderInQuestion in (folders of DestinationFolder)
    ...</pre>
    This automatically sets the iterator (in this case, FolderInQuestion, to the first item in the list and increments it for each iteration through the loop.
    Secondly, in your shell script itself, scrub the entire do/done loop. You're already using find, so have that do the hard work using the -exec switch:
    <pre class=command>find path -name "*.mov" -exec /usr/local/bin/decode {} \;</pre>
    In find's case, {} is substituted with the current file's path.
    Putting this together you'd get:
    <pre class=command>tell application "Finder"
    set DestinationFolder to "xxxxxx:xxxx:xxxx"
    repeat with folderInQuestion in (get folders of folder DestinationFolder)
    do shell script "cd " & quoted form of POSIX path of folderInQuestion & "; find . -name \"*.mov\" -exec /usr/bin/decode {} \\;"
    end repeat
    end tell</pre>
    Note that I've used 'quoted form of POSIX path' - this takes care of any shell-unsafe characters like spaces in the path name. I've also used \\; for the -exec switch - this is so that AppleScript passes the \ to the shell command rather than using it for its own escaping.
    But you're not done yet!
    There's still one fatal flaw in this process - and that is the fact that find by default, is recursive - it will walk through every directory that it finds.
    This means that if you start at the top folder and iterate through, find will find all .mov files and decode them. Your script then cd's to the first subdirectory and repeats the process - decoding all the .mov files in that directory and all its subdirectories even though they've ALREADY been decoded.
    The upshot is that you only need to run one loop starting at the top level. You don't need to iterate through all the subdirectories since find will do that for you.
    In addition to that, there might not be a need to use cd at all since the first argument to find is the directory to start searching in. Unless there's some reason that you need to start decode from the top level directory (e.g. is that where it saves the files?), you can drop the whole repeat loop altogether and just run with:
    <pre class=command>set startFolder to (choose folder)
    do shell script "find " & quoted form of posix path of startFolder & " -name \"*.mov\" -exec /usr/bin/decode {} \\;"</pre>
    That's the entire script - a radical compression of your original.

  • How can i pass parameter values from html to a shell script

    Hi Guys...
    I had a requirement where i need to execute a sql statement and print the output in HTML page. This report has parameters to enter. So i created a HTML form which accepts parameters. When the submit button is pressed, the action tag in the form invokes unix shell script file. It will open sqlplus and run the sql script file .sql and print the output in the HTML page.
    sql script contains the query and some set options which prints the output in HTML page. Like "SET MARKUP HTML ON"... The query has some parameters like "select * from emp where empno = &&empnumber. I will use the same name "empnumber" while created the HTML parameter form like " <input type = "text" name="empnumber" size="10" align="left">.
    user sees this parameter form and enters some value in to that empno text box.
    My question is how can i catch these parameter values in a shell script and pass it to the sql script to execute it.
    Help Appreciated
    Thanx

    This is a A Bad Idea (tm). This type of CGI processing is old and were (and still is) full of security holes. Very easy to inject stuff (Unix commands and SQL) into it.. To get those parameters into SQL*Plus requires using Unix shell commands to process it - and something like a backquote allows all kinds of nasty stuff to be injected. The Unix shell was never designed to be used as a secure CGI environment.
    There are far better and far superior alternatives. Perl (with Perl_DBI) and PHP (using Zend Core for Oracle) come to mind as web scripting languages.
    Even easier is using HTMLDB. Very few moving parts. Is free. Supports Oracle 9.2 and 10G.

  • Executing a shell script from a java program

    Hi,
    I'm facing a problem while executing a shell script from a jsp page.
    I'm using exec() function.
    It's working fine for single statement scripts.But if the script consists of any database processing and some other processing statements,it's not returning the correct exit status of the process.
    Will u please help me in this.
    If there is any other ways to execute a shell script from a jsp page other than Runtime.exec().If so let me know.
    Thanks in advance.

    I think this shud workMaybe - but it is wrong! Why do you create aReader
    and then read bytes which are turned into a String
    without worrying about whether or not the bytes area
    String and without worrying about the character
    encoding if the bytes do represent characters and
    without worrying about how many bytes wereactually
    read.
    Also, both you and the OP should read, digest and
    follow the advice given in
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-
    traps.htmlI dont care if it is wrong. This code works for me.
    We are here to solve problems not to find which post
    is wrong.It is wrong! You are posting bad advice that is very wrong! It may work for you but it is wrong in general! WRONG WRONG WRONG.
    If you have a solution then post it I did post a solution! The reference I gave will explain to you and the OP exactly how it should be done.
    rather then
    posting rude comments.I was not rude! I was explaining just some of what was wrong!

  • Please help me remove the last elements of shell script from my applescript

    I read somewhere that running a shell script in an applescript was inefficient and created extra overhead, fine, so I am trying to take all of my shell script out of my applescript (this should fix issues with forward slashes in names as well...)
    however I am stuck on these last two lines (I know they are probably trivial but I've been up waaaay too long now) so I was wondering if anyone would be awesome enough to show me how to convert the bash to applescript.
    --does a recursive copy and rename
    do shell script "cp -R " & (thePath as text) & " " & (theOtherPathWithFile as text)
    --does a copy and rename, then a simple move
    do shell script "cp " & (quoted form of (POSIX path of this_item as text)) & " " & (theNewPath as text) & "&& mv " & (theOtherPathWithFile as text) & " ~/Desktop"
    Any and all help will be appreciated.

    There isn't anything wrong with using shell scripts, especially since AppleScript is designed to do this very thing. There is some overhead when using do shell script, just as there is some overhead when using an application tell statement, so it just depends on what you are doing.
    The performance of any particular script would also be up to whatever is acceptable to you (or your customers), and sometimes a shell script is the most efficient way to do something. Many of the system utilities are just GUI front-ends to a shell script, so they can't be all bad.
    To do your file copy or move with the Finder, you will need to tell it to duplicate or move the item(s) (there is that pesky overhead again). Shell scripts use POSIX paths while the Finder uses colons as its path delimiter, so you will need to use the correct file path references - there is a decent article about that at Satimage. Once your file paths have been defined (or using something like choose file or choose folder)), your script would be something like:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    tell application "Finder"
    duplicate source to destination
    -- move source to destination
    end tell
    </pre>
    See the Finder and *System Events* scripting dictionaries for more information about the ways they deal with files.

  • How to truncate text in a shell script? [SOLVED]

    Here is my shell script...
    #!/bin/bash
    case "$1" in
    artist) dcop amarok player artist ;;
    title) dcop amarok player title ;;
    esac
    I want it to send the artist and title truncated if they are more than 20 characters and with a little '...' ellipsis at the end. Can anyone help me?
    Last edited by tony5429 (2008-03-12 13:28:24)

    This might be a starting point, even though I don't know the answer: http://developer.apple.com/documentatio … 03521-SW16 (gosh what a long URL)
    edit
    wow, I was slow
    Last edited by finferflu (2008-03-11 20:52:38)

  • Tips for parsing xml in a shell script?

    Hello,
    I'm writing a shell script to extract info from an xml file to create various text files that share data in the form of custom entities declared at the top of the document (product id, name, version, copyright date, etc.). So far I'm using xmllint which is working well. I'm extracting text for my project files using xmllint --shell:
    <pre style="padding-left: .75ex; padding-top: .25em; padding-bottom: .25em; margin-top: .5em; margin-bottom: .5em; margin-left: 1ex; max-width: 80ex; overflow: auto; font-size: 10px; font-family: Monaco, 'Courier New', Courier, monospace; color: #222; background: #eee; line-height: normal">echo cat lls_cd_product/plist | xmllint --noent --shell xyz.xml | sed -e '1d; $d'</pre>
    This is working well, but --shell mode adds an extra line to the beginning and end which I let sed cleanup, but then I need to strip the enclosing tags as well.
    Xmllint does a good job of filling in my entities with the exception of MacRoman bullet characters that I've entered as &#165;. These are just converted to the same entity in hex, &#xA5;. I suppose I can replace those with sed, but that's starting to feel kludgey.
    I'm beginning to wonder if there may be a better way to do this. I'm not very familiar with XSL, but I am considering ramping up on that.
    Any suggestions would be welcome.
    Cole

    etresoft wrote:
    It may be a few hours before I get time to work on it.
    Or not.
    Here is your XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <info>
    <ver>2.1.1</ver>
    <tag>abc</tag>
    <name>Product Name</name>
    <filename>productname</filename>
    <copyright>2008</copyright>
    </info>
    This generates the cd product file:
    <?xml version="1.0"?>
    <xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
    <xsl:output method="xml" indent="yes" version="1.0" encoding="UTF-8"
    doctype-system="http://www.apple.com/DTDs/PropertyList-1.0.dtd"
    doctype-public="-//Apple Computer//DTD PLIST 1.0//EN"/>
    <!-- You could access addition data from some other XML file. -->
    <!-- <xsl:variable name="data" select="document('data.xml')/data"/> -->
    <xsl:template match="info">
    <plist version="1.0">
    <dict>
    <key>hfs-openfolder</key>
    <string>.</string>
    <key>hfs-volume-name</key>
    <string><xsl:value-of select="name"/></string>
    <key>hide-hfs</key>
    <string>./{Norton,*.txt,*.exe,.inf}</string>
    <key>hide-iso</key>
    <string>./{PDS,*Rename,readme,.Volume*,Norton*,*icns,Run*.app,Icon*,Desktop*,TheFolder}</string>
    <key>hide-joliet</key>
    <string>./{PDS,*Rename,readme,.Volume*,Norton*,*icns,Run*.app,Icon*,Desktop*,TheFolder}</string>
    <key>iso-volume-name</key>
    <string><xsl:value-of select="tag"/></string>
    <key>joliet-volume-name</key>
    <string><xsl:value-of select="name"/></string>
    </dict>
    </plist>
    </xsl:template>
    </xsl:stylesheet>
    and this generates the Mac read me file in XML:
    <?xml version="1.0"?>
    <xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
    <xsl:output method="xml" indent="yes" version="1.0" encoding="UTF-8"/>
    <!-- You could access addition data from some other XML file. -->
    <!-- <xsl:variable name="data" select="document('data.xml')/data"/> -->
    <xsl:template match="info">
    <!-- You don't have to deal with these entities anymore. You should be
    able to save this xsl file in UTF-8 format and just type in the
    bullets. But the entities work too. -->
    <readme_mac><xsl:value-of select="concat(name, ' ', ver)"/>
    Copyright <xsl:value-of select="copyright"/>, Laureate Learning Systems¨, Inc.
    Minimum System Requirements:
    ¥ 300 MHz or faster PowerPC, Intel or better CPU
    ¥ Mac OS 8.1 or later, including any Mac OS X
    ¥ 64 MB available RAM
    ¥ 60 MB available disk space
    </readme_mac>
    </xsl:template>
    </xsl:stylesheet>
    This one will output the readme in HTML:
    <?xml version="1.0"?>
    <xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
    <xsl:output method="html" indent="yes" version="4.0" encoding="UTF-8"/>
    <!-- You could access addition data from some other XML file. -->
    <!-- <xsl:variable name="data" select="document('data.xml')/data"/> -->
    <xsl:template match="info">
    <!-- You don't have to deal with these entities anymore. You should be
    able to save this xsl file in UTF-8 format and just type in the
    bullets. But the entities work too. -->
    <html>
    <head>
    <title><xsl:value-of select="concat(name, ' ', ver)"/></title>
    </head>
    <body>
    <xsl:value-of select="concat(name, ' ', ver)"/>
    Copyright <xsl:value-of select="copyright"/>, Laureate Learning Systems¨, Inc.
    Minimum System Requirements:
    300 MHz or faster PowerPC, Intel or better CPU
    Mac OS 8.1 or later, including any Mac OS X
    64 MB available RAM
    60 MB available disk space
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    Yes. I do enjoy XSL quite a bit

  • Configuring Shell Script

    I am a newbie to Shell Scripting.
    I am trying to set up a Unix Resource on my IDM system.
    I have a Test Machine (which is Remote, of course). Naturally, the machine is Unix-based. Within this machine is a Unix Database, which is MySql-based.
    On this machine, I created a User (complete with full Administrator rights and privileges).
    And, to this user's Home Directory, I added certain a scripts which is meant for "*Creating a new User"* in the Unix Database. This script is written in PERL language.
    I created the Shell Resource, by using the IDM sample Shell Script files (the ones located in the IDM sample-folder). Naturally, I modified certain attributes, removed others, etc, etc.
    My problem is : the Get Resource Action and Get Result Handler.
    These two things are MANDATORY when configuring Shell Script. I have absolutely no idea how to write those scripts.
    I have searched everywhere online (sun docs, forums, even google).
    Could anyone please give me an idea of how to code/write the script for those Actions?
    Thanks

    Thanks for your replies.
    I was able to get the "Create User" process to work. What I did was design a custom-script which is suited to my own Unix environment.
    t worked (or, it seemed to work).
    In IDM, i got the following error :
    *Error detected: [Adding account to hosts and creating quotas]&amp;amp;amp;#xD;&amp;amp;amp;#xA;Default shell for netpasswd is /usr/alt/uadm2/bin/nologin. This can be changed later.&amp;amp;amp;#xD;&amp;amp;amp;#xA;Default shell for sui-dev is /usr/alt/uadm2/bin/nologin. This can be changed later.&amp;amp;amp;#xD;&amp;amp;amp;#xA;Default home path for sui-dev is /home. This can be changed later.Default shell for ssl3 is /usr/alt/uadm2/bin/nologin. This can be changed later.&amp;amp;amp;#xD;&amp;amp;amp;#xA;Default shell for sui-test is /usr/alt/uadm2/bin/nologin. This can be changed later.&amp;amp;amp;#xD;&amp;amp;amp;#xA;Default home path for sui-test is /home. This can be changed later.[Adding user to groups]&amp;amp;amp;#xD;&amp;amp;amp;#xA;[Creating home directory]&amp;amp;amp;#xD;&amp;amp;amp;#xA;DUMMY - ssh -2 -l root sui-dev "/usr/alt/uadm2/libexec/mkhome sui-dev /users1/u1/mjerome 44444 500 550 mjerome"&amp;amp;amp;#xD;&amp;amp;amp;#xA;DUMMY - ssh -2 -l root sui-test "/usr/alt/uadm2/libexec/mkhome sui-test /users1/u1/mjerome 44444 500 550 mjerome"&amp;amp;amp;#xD;&amp;amp;amp;#xA;[all done].*
    Result Code = 120.
    Error
    *com.waveset.util.WavesetException: An error occurred adding user 'mjerome' to resource 'Unix Administration'. com.waveset.util.WavesetException: Error detected: . com.waveset.util.WavesetException: Error detected: [Adding account to hosts and creating quotas] Default shell for netpasswd is /usr/alt/uadm2/bin/nologin. This can be changed later. Default shell for sui-dev is /usr/alt/uadm2/bin/nologin. This can be changed later. Default home path for sui-dev is /home. This can be changed later.Default shell for ssl3 is /usr/alt/uadm2/bin/nologin. This can be changed later. Default shell for sui-test is /usr/alt/uadm2/bin/nologin. This can be changed later. Default home path for sui-test is /home. This can be changed later.[Adding user to groups] [Creating home directory] DUMMY - ssh -2 -l root sui-dev "/usr/alt/uadm2/libexec/mkhome sui-dev /users1/u1/mjerome 44444 500 550 mjerome" DUMMY - ssh -2 -l root sui-test "/usr/alt/uadm2/libexec/mkhome sui-test /users1/u1/mjerome 44444 500 550 mjerome" [all done]. com.waveset.util.WavesetException: Result Code = 120.*
    From what is written there, I could see that the user was INDEED created. (Just to be sure, I checked my Unix machine. And, yes, the user was created. I also checked the MySQL database, and the user is there, too)
    However, I keep getting the above error in IDM.
    I can't figure out any explanation besides the fact that, perhaps, this is because I do not have a RESULT HANDLER script in place yet.
    And, this is where my problem is : some documentation on Shell Script say that Result Handlers are needed only for two Actions : GetUser and GetAllUsers.
    However, other documents claim that Result Handlers are needed for ALL resource actions. (In other words, if you have a Create User resource action, then you must have a Create-User result handler).
    I don't even know which of these claims is true.
    Any help, please?

  • Need UNIX Shell script

    My file(xxx.mf) contains big single line which includes header,details,tailer and number of records.
    example
    RA.........RW...RS.....RW....RS.....RW...RS..RT...39214
    This RA......... header record(1024 bytes)
    RW...RS.....RW....RS.....RW...RS..(38MB approximately)
    RT...Tailer record(1024 bytes)
    39214 number of records.
    User needs as
    RA......
    RW..
    RS...
    RW..
    RS...
    RW..
    RS..
    RT.....
    39214
    I need shell script to get above result. Please help me regarding this.

    trivial ksh shell script to insert linefeed characters in file
    #!/bin/ksh
    # copy input file and insert linefeed characters in output file
    # parse string and insert linefeed after each fixed-length record
    # input file: testin.txt
    # contains 10 5 character records in one string
    # R0001R0002R0003R0004R0005R0006R0007R0008R0009R0010
    # output file: testout.txt
    # contains 10 records separated by linefeed
    # R0001
    # R0002
    # R0003
    # R0004
    # R0005
    # R0006
    # R0007
    # R0008
    # R0009
    # R0010
    # arguments:
    # $1 input filename
    # $2 output filename
    str=`cat $1`
    rec_len=5
    str_len=$((`expr length ${str}`))
    rec_cnt=$((${str_len}/${rec_len}))
    i=1
    while (( i <= $str_len ))
    do
    rec_out=`expr substr $str $i $rec_len`
    echo ${rec_out} >> $2
    (( i += $rec_len ))
    done

  • Passing Multiple Parameters to SQL Script from a Shell Script

    Hi Friends,
    I have SQL script which accepts 6 parameters.
    I am calling this from a shell script as shown below:
    sqlplus -s  ${ORACLE_ID} @${SQLPATH}KORONT_041.sql ${USER_ID} ${PDC} ${item_number} ${KORDC} ${PDCSET} ${last_Updated_in_hours} Out of the six parameters, item_number is not a mandatory parameter.
    When i pass all six parameters, there is no issue.
    But when i leave item_number blank, i am getting the below error
    Enter value for 6:
    User requested Interrupt or EOF detected.Based on the error, it seems that the NULL values for item_number is ignored and SQL*PLUS is waiting for one more input from user.
    How can i overcome this issue?
    Regards,
    Sreekanth

    Hi,
    I am calling the shell script from concurrent program and below is the log file of the concurrent program.
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    KORONT_041_SH module: KORONT - Daily Item Master Update
    +---------------------------------------------------------------------------+
    Current system time is 29-JUN-2011 10:09:35
    +---------------------------------------------------------------------------+
    REQUEST_ID: 68510795
    USER_ID: 4219
    PDC:    85
    Item Number:
    KORDC:    124
    PDCSET:   1100000003
    last_updated_in_hours: 24
    EMAIL_ID: [email protected],[email protected]
    SQLPATH: /e381/oracle/asodev01appl/custom/motont/1.0.0/sql/
    RPTDIR:  /e381/oracle/asodev01comn/admin/out/ASODEV01_asoprdb2
    RPTFILE: o68510795.out
    Table truncated.
    *Enter value for 6: User requested Interrupt or EOF detected.*
    Table truncated.
    old  15:       AND ic.organization_id   = &&4
    new  15:       AND ic.organization_id   = 1100000003
    0 rows created.
    Input truncated to 9 characters
    old   8:                AND organization_id   = &&4
    new   8:                AND organization_id   = 1100000003
    0 rows created.
    End of SQL
    No record.
    +---------------------------------------------------------------------------+
    Executing request completion options...
    +------------- 1) PRINT   -------------+
    Printing output file.
                   Request ID : 68510795      
             Number of copies : 0      
                      Printer : noprint
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed successfully
    Current system time is 29-JUN-2011 10:09:38
    +---------------------------------------------------------------------------+Regards,
    Sreekanth

Maybe you are looking for

  • "Purpose of SM30"

    What is the Purpose of SM30 Transaction Code ?

  • MBP eating up all of my bandwidth

    Hello, here is a little background info - these are the computers/devices involved 15" MBP unibody 13" MBP unibody 24" iMac Xbox 360 My router is a Buffalo WHP 54 GS thats been flashed with Tomato. My issue is that the 13" MBP eats up ALL of my bandw

  • How to run Weblogic Server 8.1 in Win 98/Red Hat Linux

    I've receieved the Weblogic Server 8.1 Evaluation version. I've installed it successfully. But while I try to start the Weblogic Server the progress bar shows the completion of the server start but the indicator does not turn green. What might be the

  • How to place time stamps without creating delays?

    Hi, I am measuring signals when the PFIO input is triggered. This occurs at a variable rate, but in the khz range. I need to place a time-stamp every 100ms or so on the measurements, but I am not sure how to do this without creating a 100ms delay in

  • Regarding list of values

    I was trying to create a list manager with the values from this sql stmt select vb.vcbauto, v.vendor_name, c.contact_name, b.bid_number, b.contract_description from purch_vendor_bid vb, purch_vendor v, purch_contact c, purch_bid b, purch_vendor_conta