SAP and Korn shell scripts

Hi,
It looks SAP default is c-shell only.  I have an issue, when remote calls (rsh) to OS to run a command, k-shell script does not source the .profile.  Do any one face this issue? how it was resolved.
Thanks, R

Hi,
It is a very, very long time, but as far as I remember that is an issue with the rsh.
I think the solution is not to use the Ksh on the destination.
I think there is/was a note indicating so.
For that reason SAP does recommend to use only the cshell.
Edited by: Fidel Vales on Nov 14, 2009 11:02 AM
hi again.
Check note 202227.
> In general, you can use the Korn shell (ksh) as a login shell, however, note that the implementation of the Korn shell differs among the different UNIX platforms. This has lead to problems within SAP, in particular this is the case when you start external programs from an SAP system.
and note 188772
> The .profile file is not read under ksh.

Similar Messages

  • Oracle 10g and Korn Shell Scripting

    I have a table,SALES_STAGING, with 3 main columns.
    Sales_Date, Sales_type,Sales_Code.
    A sale is added to the table then waits until approved to be processed. The Sales_Code is 1(waiting approval). Then manually changed to 2 every 30 minutes by sales staff except on weekends. By Monday,a large queue develops. This must be changed because the queue is slowing the system. Can someone help create a Unix Korn shell script to
    1) Run every 30 minutes via Crontab
    2)login to the Oracle DB.
    3)Count the number of records to be processed, if any.
    4)Update another 'log' table with the time it ran and the records to be processed
    5)if there are less than 20 add another 50 to be processed by changing the Sales_Code from 1 to 2.
    This would really help out tremendously! Thank you.

    Wait... Isn't this forum designed for the sharing of information? The experts here shouldn't be concerned whether the request is from a Student, Oracle newbie or Developer and should focus on the request. If you are capable of assisting then I am hoping you will out of the core respect for professionalism and the motivation to provide something of value to others. If not, don't waste my time or any one else by responding with preconceived judgments and insulting remarks as these will be reported.
    Sales transactions can peak at 20,000 per hour with an average of several million thru the week. Those sales by VIP customers are immediately identified and have a priority for approvals because their balances can easily exceed $1,000,000.00. There is a pre-approval process to be introduced but until programs can be modified/tested and deployed we need a quick fix. The programming system isn't slow, it's the limited human resources approving VIP customers. My request was to keep it simple and expand on it myself to include the entire scope of our project. dbms_scheduler, although a good idea will require DBA assistance and there is no resource available. I need a simple working model to give me some direction/ideas...

  • Procedure call from SQL*Plus in Korn Shell Script

    I am trying to excute a procedure from sqlplus, truncate_audit_table. I doesn't execute. If I do it manually
    it executes. I have tried multiple ways, as below. This is inside a Korn Shell scripts that creates the procedure
    and counts the aud$ table. All that works, but does not truncate the aud$ table. It does not do it, no error, just
    passes it by. Does anybody know why?
    ${ORACLE_HOME}/bin/sqlplus -s / << EOF | tee -a ${LOG}
    set feedback on
    @/backup/oracle/orcl/audit/truncate_audit_table.sql
    select count(*) from sys.aud$;
    exec truncate_audit_table;
    exit
    EOF
    ${ORACLE_HOME}/bin/sqlplus -s / << EOF | tee -a ${LOG}
    set feedback on
    @/backup/oracle/orcl/audit/truncate_audit_table.sql
    select count(*) from sys.aud$;
    begin
         truncate_audit_table;
    end;     
    exit
    EOF
    This is the procedure that is being called:
    create or replace procedure truncate_audit_table
    as
    begin
    execute immediate 'truncate table sys.aud$';
    end;
    /

    aud$ is owned by sys. You can see it does the count with or without the "\".
    It creates the procedure under SYS , but does not execute it.
    Truncate aud$ table...
    Procedure created.
    COUNT(*)
    422
    1 row selected.
    ===============================================================
    audit_maintenance.ksh Completed: Thu Oct 26 14:03:17 GMT 2006
    ===============================================================

  • Korn shell script

    Hi,
    I have created korn shell script whoch takes records and spool into file as every column is ~ seperated. At the last I have to show total count as this one
    '[EOF <<count>>]' It is displaying but '[EOF' at one line and then ACTUAL COUNT value at next line.code is like this
    cnt variable in this I already take as count from query. Can anybody helps me?
    CREATEOUTPUT=`sqlplus -s $DATABASE@$ORACLE_SID <<SQLSCRIPT
         set heading off;
            set feedback off;
         set echo on;
         set verify off;
         set linesize 150;
         set pagesize 0;
         spool $filename
         /* 1.0 version developer needs to be change this with every relase*/
            SELECT '$BILL_SYSTEM'||' '||to_char(gnvgen.systemdate,'DD/MM/YYYY HH:MI:SS')||' '||'1.0' from dual;
         SELECT b.account_num ||'~'||
                        FROM pvaccount12 b,pvcustomer7 c,PROVIDER d,pvcustomertype2 e,pvbillsummary13 f
         WHERE b.customer_ref=c.customer_ref
         AND c.PROVIDER_ID= d.PROVIDER_ID  
         AND c.customer_type_id = e.CUSTOMER_TYPE_ID
         AND f.account_num =  b.account_num
         AND F.OUTSTANDING_DEBT_MNY <>0
         AND b.invoicing_co_id=3
         AND trunc(f.bill_dtm) <= trunc(gnvgen.systemdate)
         ORDER BY b.account_num;
         SELECT '[EOF'||'$cnt'||']' FROM dual;
         spool off;
         exit
         SQLSCRIPT
         `

    How did you set cnt variable ?

  • Looking for input on korn shell scripts to java programs

    I have a situation where there are several korn shell scripts and some manual processes using ms access to manipulate input files that will be used to pass to an applications command level commands for the purposes of updating the applications database. That being said, I am looking at creating the same as mentioned above in Java instead of ksh scripts. Mainly for the following reasons.
    The vendor is going web based, using a Java enabled web server, so these korn shell scripts if converted to Java could be called from the web jsp pages, etc.
    The other purpose is I see Java as a better tool for parsing the flat files and calling sql commands from the parsed data.
    I admit I am more a Java programmer than a korn shell programmer.
    What thoughts does this group have to using Java or should I polish my korn shell off a bit more?
    Thanks in advance
    Dean-O

    Hi,
    Is possible run Unix script under java application?, how?
    thanks

  • Need last [login, access, bind] time plugin and/or shell script

    Hi Gurus,
    I was wondering if anyone could share their pre-op bind plugin (and/or shell script) to store the last access time. We have a heterogeneous UNIX environment (Solaris, HP-UX, and Linux clients and Sun JES DS 5.2 on Solaris 9 as name service repository) and need to implement account suspension if the user has not logged in in the specified period.
    Thanks.

    Thanks for the reply, I've updated my OP with proper code tags.
    The g13 is a gaming keyboard https://wiki.archlinux.org/index.php/Logitech_G13
    I'm attempting to use the 'g13' outlined section
    I will look into udev rules, thanks again.

  • PLSQL job and unix shell scripting

    I want to be a plsql developer, now reading job ads for the technical requirement.
    This is a typical plsql job ad:
    "Technically those applying MUST have a minimum 5 years Oracle PL/SQL design and development experience combined with 3 years Informatica/ ETL exposure. You should be comfortable working off Unix platforms and associated *Shell Scripting* and database performance tuning. Experience with vendor products surrounding the compliance area such as Mantas or Actimize is highly beneficial. "
    Generally, do plsql developers work with shell scripting on a basic level, like echoing, saving files, looping etc, well, this level? : Unix Programming for dummies [http://www.amazon.com/Programming-Dummies-James-Edward-Keogh/dp/0764500619|http://www.amazon.com/Programming-Dummies-James-Edward-Keogh/dp/0764500619] . Er...this kind of of shell programming is very easy, why bother even putting the requirement in the ad? It's like saying you need to know primary school maths for the job.
    Or plsql developers work with unix programming at this kernel programming level, like semaphores, signal, UNIX Systems Programming: Communication, Concurrency and Threads? [http://www.amazon.com/UNIX-Systems-Programming-Communication-Concurrency/dp/0130424110/ref=sr_1_6?ie=UTF8&s=books&qid=1256350650&sr=1-6|http://www.amazon.com/UNIX-Systems-Programming-Communication-Concurrency/dp/0130424110/ref=sr_1_6?ie=UTF8&s=books&qid=1256350650&sr=1-6]
    I got plsql and sql tuning requirement under control, now need your help to know what level of expertise is required for unix shell scripting. What plsql developers generally do with unix shell scripting? Can you recommend a book to read?
    Many advance thanks.

    Generally, do plsql developers work with shell scripting on a basic level, like echoing, saving files, looping etcYes.
    Or plsql developers work with unix programming at this kernel programming level, like semaphores, signal, UNIX Systems Programming: Communication, Concurrency and Threads? Generally speaking, No.

  • Control SAP Services with shell script?

    Hi,
    I want to write a shell script which do atomatically stop and start all sap services which are shown in the sap mmc console.
    Does anybody knoe the command??
    Regards,
    Stefan

    Stefan,
    First you should login as <SYSID>adm and the command for startup is <b>startsap</b> and for stopping <b>stopsap</b>
    Regards
    Shravan

  • Wireless network (and a shell script for you guys, also)

    I don't know the right way to bring up my wireless iface at bootup, so I wrote a small shell script to do it for me.
    Feel free to use it if you find it useful..
    I'd also appreciate someone telling me what *IS* the arch way of doing what my shell script's doing
    #!/usr/bin/env bash
    # Val Polyakov <[email protected]>
    # 7/8/07
    # Change these to reflect your network
    PATH=/usr/sbin:/sbin:/bin
    IFACE=ifaceNameOfYourWirelessCard
    DRIVER=moduleNameForYourWirelessCard
    SID=yourSID
    ENCKEY=yourEncryptionKey
    # Don't change anything beyond this point.
    case "$1" in
        start)
            echo "Loading the wireless card driver"
            modprobe $DRIVER
        echo "Setting up the SID and encryption key"
            iwconfig $IFACE essid $SID enc $ENCKEY
        echo "Bringing up the wireless interface"
        ifconfig $IFACE up
        if [ -f /var/run/dhcpcd-$IFACE.pid ]
        then
            rm /var/run/dhcpcd-$IFACE.pid
        fi
        echo "Running the dhcp client"
        dhcpcd $IFACE
        stop)
            echo "Bringing down the wireless interface"
        ifconfig $IFACE down
        echo "Unloading the driver"
        rmmod $DRIVER   
        restart)
            $0 stop
        sleep 2
            $0 start
            echo "usage: $0 {start|stop|restart}"
    esac
    exit 0

    brain0 wrote:If your wireless drivers support wpa_supplicant, you could try autowifi from http://www.archlinux.org/~thomas/autowifi-svn/ It handles multiple wireless networks very well. There is no documentation right now, just read here: http://archlinux.org/pipermail/arch-dev … 00867.html
    what would the benefit of that be, as compared to my script ?
    the shell script i made (and pasted) works just fine, sits in /etc/rc.d and is called by /etc/rc.conf
    i was just curious whats the official, i guess, way to do it with arch
    since network profiles dont work for some reason, i figured i must be missing something..

  • Host in forms 10g and execute shell script

    Hi!
    I have a little problem. When I transfer form to AS through SSH protocol I want to automatically generate form on AS wit h code:
    declare
    lv_server_dir vc2() := /folder1/folder2;
    lv_file_name vc2():= a.fmb;
    host(lv_server_dir||'/ftp_gen.sh '||lv_server_dir||' '||lv_file_name);
    In file ftp_gen.sh is code:
    export ORACLE_HOME=myOracleHome
    export PATH=$PATH:$ORACLE_HOME/bin
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    export SQLPATH=$ORACLE_HOME/dbs
    export NLS_LANG=SLOVENIAN_SLOVENIA.EE8ISO8859P2
    export DISPLAY=:2
    cd $1
    ./gen.sh $3
    When I execute this command on form nothing happens.
    What could be wrong?
    Thanx,
    Bojan

    Hi Bojan,
    Executing the HOST Command will execute in the Mid Tier and nothing will show up in the Client. (other than the form go into Blocking mode). Just check out whether the Operation you wanted to do in the Mid tier is done or not. (Here it looks like you are compiling a form. So, check out that the fmx is generated.)
    Alternatively to check out the proper execution of the HOST command, you can generate a file in the Mid-tier (on successful execution of the shell script) and read the file using TEXT_IO and display a message to user.
    HTH.

  • Get all .pdf file in a folder and do shell script

    Hi, I need to convert many pdf to ps using pdf2ps, and I'm try to do this with applescript:
    tell application "Finder"
    set pdf_folder to (choose folder)
    set pdf_path to POSIX path of (item of folder pdf_folder whose name...)
    end tell
    repeat with k in pdf_path
    set kl to ... -- same of k but with extension .ps
    do shell script ("pdf2ps "&k&" "&kl)
    end repeat
    but I don't know how implement that.
    Can anyone help me?
    Thanks!

    01. The 'tell application "Finder" ... end tell' code block is not required to call 'choose folder'. View the 'Standard Additions' dirctionary.
    02. 'choose folder' returns a single alias - if only a single folder is to be selected, or a list of 'alias'es - if 'multiple selection allowed' is set to true.
    03. 'pdf2ps' is not part of Apples' UNIX commands installation; and you did not provide a valid URL for others to download the UNIX command.
    Code to process only a single selected folder.
    -- Code starts here --
    try
    do shell script ("pdf2ps " & (quoted form of (POSIX path of ((choose folder) as string))))
    end try
    -- Code ends here --
    Code to process multiple selected folders.
    -- Code starts here --
    set pFolder to choose folder with multiple selections allowed
    if ((count pFolder) > 1) then
    set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ""}
    set pFolder to text items of pFolder
    repeat with i from 1 to (count pFolder)
    set (item i of pFolder) to quoted form of (POSIX path of (item i of pFolder))
    end repeat
    set AppleScript's text item delimiters to " "
    set pFolder to pFolder as string
    set AppleScript's text item delimiters to oAStid
    else
    set pFolder to pFolder as string
    end if
    try
    do shell script ("pdf2ps " & pFolder)
    end
    -- Code ends here --

  • Automator and "Run Shell Script" error

    First, if I'm in the wrong place with this- sorry. Figured this was an OS kind-of thing.
    I recently migrated to a new iMac ... I brought along an Automator script; I've been using it for years to perform a little rsync backup to an USB HDD. It's 'never' given me any problems ... until now!
    "*Run Shell Script*" encountered an error .. but alas, the system log is devoid of messages ... and the verbose log I have running indicates that all the files are copied/backed-up ... I would love any input on this that might help me get back on the feet. .....
    *Here's what my Shell Script Looks like:*
    Shell Option: /bin/bash
    Pass Input: to stdin
    rm -dfr '/Volumes/Backup HD/*********'
    rm -dfr '/Users/***********/Library/Logs/Profile_Backup.log'
    rsync -rltv /Users/******** '/Volumes/Backup HD/' > /Users/*******/Library/Logs/Profile_Backup.log
    (I'm sure there's way to only sync the changed stuff between backups ... but I've simply preferred the fresh copy approach).
    *I do however note this in my logs when I open Automator:*
    12/14/10 3:15:46 PM [0x0-0x42042].com.apple.automator.Backup[464] Application Stub: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.

    @Tony T1
    Thanks, I'll certainly adjust the log file as suggested
    In troubleshooting the problem I went the terminal route - and issued each command ... during the rsync process I was getting an error ... turns out when it was syncing the SyncServices folder it was encountering a copy of the keychain ... which had root permissions - naturally rsync was not able to copy the file (personally I have no idea why the keychain would be being sync'd with anything)!
    I removed the file from the sync ... I'm still doing some "debugging" to correct the problem-
    Again, thanks for the assist!

  • UNIX path AND  Do shell script path with spaces

    I am trying to building a interface with buttons to execute shell commands when the button is pressed. Below press button execute code.
    I am new to AppleScript and Xcode and Interface builder. I have read different post referencing spaces but I still don't understand.
    THIS COMMAND DOESN'T WORK IT'S SOMETHING TO DO WITH SPACES.
    How would I fix this to work.
    on clicked theObject
    do shell script "rm /Library/Preferences/com.netopia.netOctopus\ Agent.preferences"
    end clicked
    This works (Below) no spaces in the path
    on clicked theObject
    do shell script "open /System/Library/PreferencePanes/SharingPref.prefPane/"
    end clicked
    ALL Mac OS X (10.4.6)
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.6)  
    ALL   Mac OS X (10.4.8)  
    ALL   Mac OS X (10.4.8)  

    Camelot's explanation was good, but you don't seem to get it, so I'll take a crack at explaining as well.
    First off, you need to understand what "do shell script" does and does not do. "do shell script" takes a string from AppleScript and passes it to a shell interpreter. It does not check in advance that this string makes sense. (That is impossible to do, in fact.) It just passes it along. The shell interpreter then converts the string into a command, or series of commands, and attempts to run them.
    In AppleScript, quotation marks around something make that something a string. So, for example:
    "rm "
    is a string containing a letter r, a letter m, and then a space. Some commands can also return a string, which can then be stored in a named variable, as for example:
    set a_variable to (the text returned of display dialog "Hi!" default answer "Some text")
    When you wish to put two strings together in AppleScript, you use the & operator, as in:
    "String 1" & "String 2"
    In this example, there is no space at the end of the first string, and none at the beginning of the second, so the result is:
    "String 1String 2"
    All clear so far?
    When a shell interpreter attempts to convert a string into commands, it has to split the string into pieces. A space signifies a break between pieces. In order to put a space into a single item, you can do a number of things. You can put the whole item in quotation marks (single or double), which is known as "quoting":
    '/A/Path/With/A Space'
    or you can put a backslash before the space, which is known as "escaping":
    /A/Path/With/A\ Space
    You can combine quoting and escaping if you do it right. For example, the backslash also lets you use a quotation mark inside a single item which is quoted:
    "/A/Path/With/A Space/And/A\"Quotation/Mark"
    There are further rules and substitutions that sometimes border on the arcane.
    In order to simplify things, Apple created the command "the quoted form of". This command takes a string and returns a new string which is properly set up so that it will be just one item when split up for the command line. It will add quotation marks, backslashes, or whatever.
    So, to put things together:
    "rm " & the quoted form of thePath
    is a way of saying to AppleScript "take the string in the variable named thePath, and quote it for the command line; then stick it on the end of a string containing an r, an m, and a space."
    When you pass this to "do shell script", it will break things up in such a way that it hands thePath to the rm command, which will attempt to remove whatever is represented by thePath. (Adding the "-r" in there just tells the rm command "if this is a directory, get rid of it and all its contents". Otherwise rm will complain if the item is a directory.)
    I think, however, you may just have the path wrong. In one of the spots where you gave the POSIX path, it had a backslash (\) at the end instead of a forward slash (/). As Camelot says, a forward slash means that the item is a directory and not a plain file. But if you really meant the backslash, it suggests that the item is a plain file, but has a space at the end (or some other character that mystifies the command line). It's an escape.
    Try making a new script in Script Editor which says
    ">" & (the POSIX path of (choose file)) & "<" at the end, that's the culprit.
    (And if it won't let you select the file when you run the script, it means that the item is actually a folder.)

  • Need a sample file for IDQ parameter file and a Shell script to execute it from command line

    Hello,The parameter file itself is generated from cmd line using infacmd command and it automatically creates the parameters inside it based on the parameters created inside the mapping and the workflow. So, even if one provides you a paramtere file for IDQ, it might fail as your workflow definition and its paramters would be different. Thanks,K

    Hi all   My project migrated from Power Center to IDQ developer and I had to move all my mappings to IDQ developer. I was able to migrate everything except for the parameter files. It seems that the layout and syntax for parameter file is different from Power Center. Is there anyone who can help me out or send me a sample of a parameter file for IDQ? As well as a sample shell script to run the mapping or application from the Command line.This is an urgent need and It will be greatly appreciated.   ThanksNaveen Medisetti

  • Oracle linux disk and folder shell script

    Hi,
    Shell script that shows you how to disk , folder.

    user8053012 wrote:
    du -sh /data/oracle/ |sort -r -n |head -20 how to write shell script ..Are you asking how to write a shell script that will execute the command 'du -sh /data/oracle/ |sort -r -n |head -20'?
    If so, just use vi to create a new file, and put the command into the file. After saving the file, be sure to use 'chmod' to make it executable.
    If that's NOT what you are asking, then your second post is just as obscure as your first.

Maybe you are looking for

  • Changed library name - FCPX won't open?

    Ouch. I inadvertently changed the Library name of an FCP X file in the Finder Window ... and now FCP X won't open.  I immediately changed it back to the original name, and FCP X still won't open.  The FCP X logo comes up, and then the app seems to fr

  • Télécharger version d'essai sur yosemite

    Bonjour, je compte acheter InDesign dans les prochains jours et souhaitait au préalable télécharger la version d'essai sur un MacBook Pro rétina tournant sous yosemite. Adebe manager plante systématiquement lorsque je lance le téléchargement de la ve

  • [svn] 670: -major update to the mpl packaging target - this will now package up the correct files that are mpl

    Revision: 670 Author: [email protected] Date: 2008-02-26 18:14:40 -0800 (Tue, 26 Feb 2008) Log Message: -major update to the mpl packaging target - this will now package up the correct files that are mpl -this target is not called within this build s

  • AE CC 2014 Export to C4D not saving any file

    I just got into CC (was using CS6) and today I wanted to export a C4D file from AE, like I have done always with AE CS6, but there seems to be a problem. I click on export, Maxon Cinema 4D Exporter, then select the folder and type the file name, clic

  • Using another computer to access a catalog or files?

    I have LR installed on my MacPro and the Mac just died (graphics card issues). I'm going to just buy a new Mac, though I'm trying to figure out the best way to access everything in LR until then. All of the images and photos are stored on a separate