Mount script for ext2 - mixing applescript and shell script

Hello
i want to do a .app using the ScriptEditor to get my external usb-disc mounted.
I tried ExtFS Manager before, but was not as happy with it.
so the basic idea is some kind of mixture of apple script and bash-shell script, but im not sure how to combine it.
shell script:
#!/bin/sh
sudo kextload /Library/Extensions/ext2fs.kext
mkdir ~/usb_music/
sudo mount -t ext2 -o nosuid,w,m=777,user /dev/disk1s5 ~/usb_music/
sudo chmod a+rwx ~/usb_music/
apple-script:
on run
try
do shell script ""
end try
end run
any ideas how to get it combined and working ?
best regards
fidel
MacBookPro 15,4" 1,83 GHz   Mac OS X (10.4.8)  

is there a way to implement it in a way that normal users can work with sudo to mount the drive ?
kextload requires superuser privileges, so at some point some part of your script is going to need to run with elevated privileges.
It is possible to configure sudo to allow non-admins to run any other commands. You could either allow non-admins to to run kextload or, preferably, allow them to run your shell script.
man sudoers will give you the details on how to configure sudo to do this, which might be as simple as:
<pre class=command>ALL  ALL=(ALL) /usr/local/bin/myscript</pre>
This will allow all users to run /usr/local/bin/myscript as root.

Similar Messages

  • Applescript with Mail attachments and shell scripts (pdftk)

    I'm trying to create a script that I can call using mail rules that will:
    1. save an attached PDF file to a folder (folder name is 'PDFs_from_Mail:')
    2. save each page of the PDF as a separate file
    3. delete the old file
    so far, i used the script below called from mail to save the attachments to the
    -- script called from mail
    using terms from application"Mail"
      onperform mail action with messages theMessages
        tell application"Finder" to set ptd to (path to desktopfolder) as string
        tell application"Finder" to set pathToAttachments to(path to desktop folder as string) &"PDFs_from_Mail:"
        tell application"Mail"
           repeatwith theMessage in theMessages
                if theMessage's mailattachments is not {} then
                      repeatwith theAttachment in theMessage's mailattachments
                            settheFileName to pathToAttachments & theAttachment's name
                            try
                                     save theAttachment in theFileName
                              onerror errnum
                            endtry
                      endrepeat
                end if
             endrepeat
          end tell
      endperform mail action with messages
    end usingterms from
    tell application"Mail"
        setmyMessages to selection
        tellme to perform mail action with messages myMessages
    end tell
    -- end of script called from mail
    after the file is in the folder, i'd like to automatically call a script that splits it in to pages and saves each file.  I found pdftk can do what I need.  I got the following working, which uses a folder action script to process the file:
    -- burst script
    on addingfolder items to this_folder after receiving added_items
       tellapplication "Finder"
           set fold_name tothe name of this_folder
               try
                   repeatwith i from 1 to number ofitems in added_items
                          set theFile toitem i of added_items
                          set oldDelimiters toAppleScript's text item delimiters
                          set AppleScript's textitem delimiters to {":"}
                          set theFolder to(((text items 1 thru ((count everytext item of (theFile asstring)) -1)) of (theFile asstring))) as string
                          set AppleScript's textitem delimiters to oldDelimiters
                                --get the file name
                                   set theFileName to the name of theFile
                                                     do shell script"/usr/local/bin/pdftk " & (POSIX path oftheFile) & " burst output " & (POSIXpath of theFolder) & "/" & theFileName &"_%03d.pdf"
                                                      delete theFile
                                                    endrepeat
                                        end try
                         endtell
    end adding folder items to
    -- end burst script
    the shell script that is called is in the format:
    pdftk myfile.pdf burst
    the output parameter basically adds the page number to the end of the original filename for each file that is created
    my idea was to attach the folder action script to the 'PDFs_from_Mail' folder, and when the first script is called, the file would be saved to that folder and trigger the folder action script burst the file.  it works for individual messages, but when I try using it with the hundreds of messages that I have, all kinds of crazy things happen... the filenames are all wrong and it seems like it goes on infinitely.
    My familiarity with applescript is somewhat limited (as you may have guessed) and I'm wondering if there is a better approach.  perhaps if I incorporate the shell script into the script called from mail it may streamline everything.
    my problem is that I am not sure what code I need to keep in each script.
    can anyone take a quick look at this and give me some advice?
    my goal is to have these individual pages in a folder so that I can use quick view to page through them.  if the pdf is more than one page, then I have to get involved in scrolling up/down and it becomes difficult to find things efficiently.
    thanks!

    just a quick update and a general questions about applescripting with shell scripts...
    i attached the above folder action burst script to a folder, and have been dragging pdf files into it, one at a time.
    sometimes the script runs fine and the new files are created and the old pdf is deleted.  other times, there is a long delay between when I drop a pdf file into the folder and when the new files are created.  and sometimes nothing even happens at all (uaually if i dont wait for at least 30 seconds or so between dropping the files in the folder).  I also noticed that the window title text (area showing the folder name at the top of the finder window) becomes grayed out when the script is running and sometimes it remains grayed out for a few minutes after the script has run.
    could it be that the shell script just takes a really long time to work?  i am afraid to drop more than one file at a time as the last time I tried that the output was all wrong and I had to force quit processes and shut down. 

  • Xgettext for perl and shell scripts on Solaris 9

    Hi......I have to internationalized perl and shell scripts on Linux and Solaris 9.
    I have used gettext on linux to internationalized both perl and shell scripts but on solaris i m not able to
    achieve the same.
    If we see help of xgettect on Linux, it shows input file options for Perl, Shell, C, C++ etc but help for
    xgettext on Solaris shows input file option for C only.
    Can you please provide me some way of using xgettext for perl and shell scripts on Solaris 9 or
    is there any other way of internationalizing perl and shell scripts on Solaris 9.
    Many Thanks,
    Lokesh

    Signature link blocked.
    db
    Contentprise wrote:
    Hi......I have to internationalized perl and shell scripts on Linux and Solaris 9.
    I have used gettext on linux to internationalized both perl and shell scripts but on solaris i m not able to
    achieve the same.
    If we see help of xgettect on Linux, it shows input file options for Perl, Shell, C, C++ etc but help for
    xgettext on Solaris shows input file option for C only.
    Can you please provide me some way of using xgettext for perl and shell scripts on Solaris 9 or
    is there any other way of internationalizing perl and shell scripts on Solaris 9.
    Many Thanks

  • How to tell if item is a folder or volume with applescript or shell script?

    I am working on a service in Automator that will eject the selected drive when it is finished. Unfortunately automator can only tell the difference between files and folders for the service menu.
    Im wondering if if i can use an applescript or shell script that would check if the selected folder is a volume or folder and quit the action if its a folder. I figure the best way to do this is have it determine if the items path is in /Volumes/, but i am completely new to the process and have no idea how to do this.
    My automator workflow looks like:
    Ask for Confirmation
    Get Selected Finder Items
    Shell Script
    I have the path of the folder selected being passed into the shell script, but after its in there i dont know how to determine if its a volume or not.
    Thanks!

    K T,
    I completely missed that section of the forums, sorry
    Neil,
    I had that kind of script set up but it was like this:
    on run {input, parameters}
    tell application "Finder"
    kind of item parameters
    end tell
    end run
    And i just figured out that i had to change the first line to "on run {parameters}" and now it works great.
    Thanks for the help, it got me going in the right direction

  • Rman windows and  Shell Script

    hi,
    How to take the backup by windows script and shell script.please any one tell that.
    thanks
    with regards

    Dear user!
    How to take the backup by script is a very imprecisely kind of question. So the only thing I can give you is a very imprecise answer.
    For linux shellscript you may use:
    vim my_backup_script.sh
    #!/bin/bash
    BACKUP DATABASE;Save and run this script in the following way:
    rman target / catalog catuser/password@CATDB CMDFILE my_backup_script.shYou may customize this script to fit your needs. On Windows you may write a batchscript like that:
    notepad my_backup_script.bat
    BACKUP DATABASE;Save and run this script like that:
    rman target / catalog catuser/password@CATDB CMDFILE my_backup_script.batMaybe if you could state your needs a little bit more precisely I could give you a more helpful answer.
    Yours sincerely
    Florian W.

  • Sample shell script - to run procedures and shell script

    Hi ,
    I would like run some procedures in one shell script which passing parameters as username/password@dbname.
    1. Execute proce1
    2.Execute proce3
    3.Execute proc4
    Can you please give some script/idea how we will create shell script . I am using SunSolaris Unix operating system.I would appreciate your help.
    Regards,
    Clark

    user10818198 wrote:
    I would like run some procedures in one shell script which passing parameters as username/password@dbname.
    1. Execute proce1
    2.Execute proce3
    3.Execute proc4
    At a very basic level, based on the information you have provided, your shell script would be something like this:
    sqlplus /nolog <<EOF
    connect username/password@dbname
    exec proce1;
    exec proce2;
    exec proce3;
    exit
    EOFBesides this, you could:
    (1) Add the shebang at the top, to specify the shell you are using, e.g. #!/bin/ksh for the Korn shell etc.
    (2) Ensure that "sqlplus" is recognized by the shell, by maybe running an "ora_env.sh" script that sets Oracle parameters. More likely, if you are using this Unix account for interaction with Oracle, then you may want to add the Oracle parameter information in your .profile or .bash_profile or .csh_profile etc. in the home directory.
    (3) Run a few sqlplus commands right before calling those stored procedures, if needed. For example, if you want to exit from sqlplus (and Oracle) if an error occurs while executing any procedure, then add this -
    whenever sqlerror exit 1Thus your script becomes:
    #!/bin/ksh
    # Ensure that Oracle parameters are set by this point
    sqlplus /nolog <<EOF
    connect username/password@dbname
    whenever sqlerror exit 1
    exec proce1;
    exec proce2;
    exec proce3;
    exit
    EOF(There are other settings as well; it really depends on your requirements.)
    Can you please give some script/idea how we will create shell script . I am using SunSolaris Unix operating system.
    How to create a shell script ? Well,
    (1) Save the commands shown above in a file, using your favorite text editor. Name the file "my_script.sh" or "<a_better_name>.sh" etc. (or maybe ".ksh" for the Korn shell - it's just a best practice, the shell doesn't really care.)
    (2) Make your script executable, like so -
    $ chmod 744 myscript.sh(3) And then execute it -
    $ ./myscript.sh- You could also execute the script in the current shell (as against a child shell) by doing this after Step (1):
    $ . myscript.shHope that helps.
    If there are specific questions, then post them here.
    isotope

  • Perl Scripting -  Is it an alternative to shell scripting?

    Hi all,
    I am new to Oracle. I am trying to learn the basic concepts
    I read that PERL is a server side scripting language.
    I understand the purpose of shell scripts. I come across terms PERL shell scripts.
    I understand PERL interpreter comes with UNIX.
    1. So, is scripting using PERL an alternative to shell scripting? or
    Does it have a different purpose?
    2. If an alternative, then when would PERL scripting be better than shell scripting or vice versa ?
    3. If an alternative, can PERL be exclusively used replacing shell scripting or as mentioned in my 2nd question used based on the application.
    Your reply will be truly appreciated.
    Thanks!

    A hypothetical question: If a unix had PERL
    installation can I use it replacing the unix shell
    scripting for carrying out day to day DBA tasks? You
    mentioned it is not done that way but theoretically
    can it be done?
    Yes, if you are proficient with Perl, you can use perl to script DBA scripts. Perl is more powerful than shell script. So there's nothing Perl can't do that shell can, there are many things Perl can, regular shell can't.
    The limitation is some company has tight policy on installing non-default software on servers, especially production high security servers.
    If not for carrying out day to day DBA tasks using
    PERL scripting is there any other reason for why PERL
    may come installed or can be installed in a UNIX
    flavor?
    Like said, Perl has many useful functions and modules. With DBD/DBI module and string processing power (Regular Expression etc), Perl is very popular tool for dataloading scripts as well as phyton.
    Perl and Phyton are also heavy used for CGI application and much more.

  • I need a 2 way sync tool for the mac (or a shell script and some help)

    I am looking for a way to (two way) sync a folder on my Macbook Pro with a SMB Server (aka Windows)
    I found a few paid for applications that do this, and before I buy one I thought I'd ask here and see if there are any recommendations.
    So far I've found Synk Standard and ChronoSync.
    I assume this could also be hacked together with Automator and some shell scripts, but I'm not sure how I'd do that.

    yes, Chronosync is often recommended for this kind of thing. Never heard of Synk Standard. you can also do it for free with rsync but I suggest you stick with Chronosync.

  • Error with dbms_scheduler and shell script execution

    Hi,guys.
    I have an issue with a dbms_scheduler and a shell script execution. So, the shell script as it self works fine, when i'm executing ./test.sh all process is running, but when i'm executing the script from dbms_scheduler it just simply doesn't work. Actually it works, but some of executable information in sh doesn't work, seems it just jump over of the part of the script. Sendmail part is running, maybe there is problem with rman script as it self?
    DB version: 10g
    And my scripts:
    Shell scripts (permisons 755):
    #!/bin/ksh
    export PATH=/home/oracle/product/asm_home/bin:/home/oracle/product/db_home/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/oracle/bin:/usr/bin/X11:/sbin:.
    export ORACLE_BASE=/home/oracle/product
    export ORACLE_SID=zabbix
    export ORACLE_HOME=/home/oracle/product/db_home
    ${ORACLE_HOME}/bin/rman<<EOF
    connect target /
    run {backup recovery area delete all input;}
    EOF
    {       echo "From:[email protected]"
            echo "To: [email protected]"
            echo "Subject: Recovery area"
            echo 'Content-Type: text/html'
            echo
            echo '<html><body><table border="1" cellspacing="1">'
            echo '<tr><td><b>Process</b></td><td><b>Statuss</b></td></tr>'
            echo "<tr><td>RMAN</td><td><b>Works</b></td></tr>"
            echo "</table></body></html>"
    } | sendmail -tIn the first part i'm exporting all of the important stuff for oracle, then I call RMAN with specific atributes. And then there is just simply sendmail functionality inside script to represent if script works (for now).
    And below pl/sql script:
    begin
      DBMS_SCHEDULER.CREATE_JOB
      job_name => 'FLASH_RECOVERY',
      job_type => 'EXECUTABLE',
      job_action => '/home/oracle/backup/test.sh',
      start_date => sysdate,
      job_class => 'DEFAULT_JOB_CLASS',
      enabled => TRUE,
      auto_drop => FALSE,
      comments => 'FLASH RECOVERY USAGE AREA backup and delete'
      END;
      /And this job execution:
           begin
               DBMS_SCHEDULER.run_job (job_name =>'FLASH_RECOVERY',use_current_session => TRUE);
           end;What can be wrong? For me, I think it's something with permisions.
    I hope you got my idea and could help me.
    Tom
    Edited by: safazaurs on 2013.18.2 22:16

    There is no error, i just receive all the time e-mail, seems it jumps over rman. I tried almost everything and still couldn't get result as i want. And, if i'm running script from command line - it works. Rman calls, and starts to recover archivelogs.

  • SQL LOADER and SHELL SCRIPT ISSUE

    Hello Guys,
    I know this not the right forum but i am not sure where i should post this.
    Pelase help
    I am running a shell script which is giving me error
    Username:SQL*Loader-128: unable to begin a session
    ORA-01017: invalid username/password; logon denied
    SQL*Loader: Release 10.2.0.4.0 - Production on Thu Nov 19 13:02:04 2009
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    SQL*Plus: Release 10.2.0.4.0 - Production on Thu Nov 19 13:02:06 2009
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Enter user-name:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
    0 rows updated.
    Commit complete.
    SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition
    SQL> SQL> Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options Thu Nov 19 13:02:06 EST 2009In shell script i have used the same username and passwd which i am using from command line
    the shell script is calling sql loader to load file
    and for that also the username and passwd is same.
    i am able to run sqlldr command from command line dont knw why here its giving error
    here is my shell script
    set -a
    . $HOME/.edw.env
    . $admlib/checklib.sh
    LOGDIR=$admsrc/sigma6/ppadala/copg
    LOGFILE=${LOGDIR}/log/test`date '+%m%d'`.xtr
    DB_USER=copg
    DB_PWD=copg
    set +a
    cd $LOGDIR
    if test ! -f $admsrc/sigma6/ppadala/copg/DM_Daily_EFolderCloseCancel_Report_11192009.txt
    then
       echo "Error: DM_Daily_EFolderCloseCancel_Report_11192009.txt does not exist and/or is not a regular file." >> ${LOGFILE}
       exit 1
    fi
    echo 'End of Checking for the existence of the file - Successful'>> ${LOGFILE}
    sqlldr control=$admsrc/sigma6/ppadala/copg/Close_Cancle.ctl log=$admsrc/sigma6/ppadala/copg/Close_cancle.log
    userid=${DB_USER}/${DB_PWD} silent=\(HEADER,FEEDBACK,DISCARDS\)>> ${LOGFILE} 2>&1
    case $? in 0) :;;1|3) echo "Error: SQL Loader" >> ${LOGFILE}
         exit 1;;
    esac
    sqlplus << EOD
    ${DB_USER}/${DB_PWD}
    @Close_Cancle.sql
    EOD
    if [ $? -ne 0 ]
    then
        echo "Error: SQL Plus for script Processing" >> ${LOGFILE}
        echo "Resi Unit Scheduling Report Refresh failed" >> ${LOGFILE}
    fi
    ) > ${LOGFILE} 2>&1
    echo `date` >> ${LOGFILE}
    if [ -f ${LOGFILE} ]
    then
    mail -s "Resi Unit Scheduling" "[email protected]" < ${LOGFILE}
    sleep 3
    `ck_error ${LOGFILE}`
    fiplease help guys
    thanks

    Thanks for the reply
    In Close_cancle.log also its the same msg which i posted.
    logon denied..............
    and this is the log file contents when i do set - X on
    + cd /u2144009/src/sigma6/ppadala/copg
    + test ! -f
    + /u2144009/src/sigma6/ppadala/copg/DM_Daily_EFolderCloseCancel_Report_1
    + 1192009.txt echo End of Checking for the existence of the file -
    + Successful
    + 1>> /u2144009/src/sigma6/ppadala/copg/log/test1119.xtr
    + sqlldr control=/u2144009/src/sigma6/ppadala/copg/Close_Cancle.ctl
    + log=/u2144009/src/sigma6/ppadala/copg/Close_cancle.log
    Username:SQL*Loader-128: unable to begin a session
    ORA-01017: invalid username/password; logon denied
    SQL*Loader: Release 10.2.0.4.0 - Production on Thu Nov 19 17:32:17 2009
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    + userid=copg/copg silent=(HEADER,FEEDBACK,DISCARDS)
    + 1>> /u2144009/src/sigma6/ppadala/copg/log/test1119.xtr 2>& 1
    + :
    + sqlplus
    + 0<<
    copg/copg
    @Close_Cancle.sql
    SQL*Plus: Release 10.2.0.4.0 - Production on Thu Nov 19 17:32:58 2009
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Enter user-name:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
    0 rows updated.
    Commit complete.
    SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition
    SQL> SQL> Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    + [ 0 -ne 0 ]
    Thu Nov 19 17:32:59 EST 2009Edited by: user10647455 on Nov 19, 2009 2:35 PM

  • 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

  • Command line parameters and Shell Script -- URGENT

    Hi folks,
    I am facing some problem in the Shell script and the command line parameter.
    The scenario is -- I am picking a file from a directory, whose path is <b>/interfaces/xid/receive/filename.dat</b>
    I have to encrypt filename.dat and move it to another folder, whose path is <b>/interfaces/xid/send</b>. So, the encrypted file will reside in the <b>send</b> directory.
    Now, I don't want to hardcode the new path, where the encrypted file has to be moved. Please let me know how to achieve this. Please consider this as urgent.
    Have a look at the command line in the "before message processing"  -- <b>/interfaces/xid/receive/xi_decompress.sh  /interfaces%F</b>
    Have a look at the shell script for the same --
    #!/bin/sh
    Setup environment variables
    COMMPRESS_DIR=/interfaces/software/commpress
    export COMMPRESS_DIR
    LOG_DIR=/interfaces/software/commpress/log/
    export LOG_DIR
    IN_FILE=$1
    export IN_FILE
    Find the directory where the unencrypted file is deposited
    IN_FILE_DIR=`dirname $1`
    export IN_FILE_DIR
    Make sure the working directory is where the unencrypt.key is...
    cd $COMMPRESS_DIR
    encrypt the file
    if [ `uname` = "HP-UX" ]
    then
       find $IN_FILE | $COMMPRESS_DIR/compx $IN_FILE_DIR logpath=$LOG_DIR
    else
       find $IN_FILE | $COMMPRESS_DIR/compx-sun $IN_FILE_DIR logpath=$LOG_DIR
    fi
    Get the result of the encryption
    RET_CODE=$?
    Check decryption result
    If error (retuen code <> 0), create an error log file in the
    same directory as the input file.
    if [ $RET_CODE -ne 0 ]
    then
        PREFIX="Decryption"
        DATE_TIME=$(date +%Y%m%d_%H%M%S%N)
        SUFFIX="err"
        FILENAME=$/$_$.$
        echo "Decryption Error log"        >$FILENAME
        echo "DATE_TIME:  $"   >>$FILENAME
        echo "DIRECTORY:  $" >>$FILENAME
        echo "FILE:       $"     >>$FILENAME
        echo "ERROR CODE: $"    >>$FILENAME
    fi
    exit $RET_CODE
    What else I need to add in this piece of code? Urgent help !!
    Thanks a lot in advance.
    Neetesh

    Hi Satish,
    I was able to figure that out, that we need to hard code the path as the 2nd parameter.
    But I guess there is a way out in Unix where we can handle this situation, where we are not willing to hard code.
    Anyways, thanks a lot for your input .. -:)
    Cheers,
    Neetesh

  • DBMS_SCHEDULER and Shell Script on 10.2.0.1

    Hi All
    My env, Oracle 10.2.0.1 and OS is Solaris.
    My script can run on OS that is work without error that contain create file, delete file, call sqlplus, function to get value from database and return to OS variables.
    In shell script some code as below
    get_val () {
    sqlplus -s /nolog <<EOF
    conn test/test
    set heading off
    set feedback off
    set pages 0
    SELECT SUBSTR (SYS_CONNECT_BY_PATH (Z, ' '), 2) z
          FROM (SELECT NAMEDQUERY , ROW_NUMBER () OVER (ORDER BY Z) rn,
                       COUNT (*) OVER () cnt
                  FROM X
                  WHERE Z LIKE '%FULL')
         WHERE rn = cnt
    START WITH rn = 1
    CONNECT BY rn = PRIOR rn + 1;
    EOF
    vx=$(get_val)
    if [ ${#vx} -gt 0 ]; then
    for xfile in $vx
    do
    rm -f $CURRDIR/$xfile.txt 2> /dev/null
    done
    fi
    When run by dbms_scheduler that show below error
    ORA-27369: job of type EXECUTABLE failed with exit code: No such file or directory
    STANDARD_ERROR="/home/oracle/script/test.sh: syntax error at line 26: `vx=$' unexpected
    How to resolve above error?  (owner of $CURRDIR/$xfile.txt is oracle user)
    One more question, How to force dbms_scheduler that using user oracle (OS) to run shell script?, as I know, default user is nobody and Oracle version 10.2.0.2 later that have external.job.ora to set it but 10.2.0.1 doesn't have it.
    Thank you in advance,
    Hiko

    I changed scheduler by set argument as below
    dbms_scheduler.create_job (job_name=>'TEST',job_type=>'EXECUTABLE',job_action=>'/usr/bin/bash',number_of_arguments=>1);
    dbms_scheduler.set_job_argument_value('TEST',1,argument_value,'/home/oracle/test.sh');
    That is work. below is conclusion to did
    1. Change permission of $ORACLE_HOME/bin/extjob to 4750 (-rwsr-x---)
    2. Change owner of $ORACLE_HOME/bin/extjob to oracle:dba
    3. Use '/usr/bin/bash' instead of '/usr/bin/sh'
    But I found error about download file process that I'm using wget to download source file in shell script and run by dbms_scheduler as above.
    My problem, first file can download normally and process until finish but second file was hang.
    Do you have any idea or solution to prove and resolve it?
    Thank you,
    Hiko

  • Looking for album artwork applescript and lyric delete applescript?

    Looking for the best applescript that will get artwork and one will delete lyric's that were downloaded? I did do a search on dougs but nothing showed up?
    edit
    also looking for one that will help fix the tags.
    Message was edited by: PokemonFan1987

    2. One single document with sheets for the time sheets and then a folder of sheets for invoices for each month, which update dynamically using SUMIF functions when the relevant data is present in the time sheets.  An applescript could then do batch exporting of all time sheets for a given month.  This would entail building a table or populating a table using something like the method you described in your answer to this question:
    (a) I apologize but I'm unable to make the difference between the word "sheet" used to name a true sheet and the same word used to name a table.
    (b) there is no way to exchange datas between a document and a "folder of sheets" without a script.
    As a Numbers document may embed a huge number of sheets able to embed a huge number of tables I guess that you may achieve your goal with a single document.
    The idea is :
    sheet 1 contains the table(s) with the main datas.
    sheet 2 contain tables building the invoices for a given month
    sheet 3 contain tables building the invoices for a given month
    In each sheet starting from sheet 2, insert a single cell table whose content is the date of the first day of the dedicated month.
    It's the contents of this cell which will be used to extract the relevant infos from the main datas.
    Advantages : a single document behaving on its own.
    Disadvantages : huge document which may behave slowly.
    I can't choose for you and I must add that the slow behavior may become a sad remembrance the day we will get the next major iWork update.
    Yvan KOENIG (VALLAURIS, France) lundi 15 août 2011 12:17:10
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    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 !

  • IWeb Applescript and Automator - scripts you shouldn't be without

    Applescript and automator will automate mundane manual repetative task that seem to take forever. These scripts fill in iWeb's void that makes it hard to implement advance features such one click ftp publishing, code editing, swithching domain site files, etc. Don't miss out on these scripts that will save you ton of time. These are scripts you shouldn't be without.
    Work smarter not harder with iWeb applescript, only from MacEzzy.
    -- Also check out the free downloadable iWeb templates.
    Powerbook G4 Ti   Mac OS X (10.4.4)  

    Thank you for your feedback.
    -- Article never mentions compressed or uncompressed. Traditionally tiff format is used for buttons and small images on web pages and jpeg is used for higher quality photos exemplified by iWeb.
    -- Search engine spiders or crawlers start from top of the page to the bottom of html pages. They craw for topic as well as content. This is exactly what appears from iWeb html pages for meta (meta name="Generator" content="iWeb 1.0.1")
    -- I am the first to admit I don't know everything but I don't make up information. I use iWeb on a daily bases and try new things to push the envelope. Things that I find helpful to me I make it available for other iWeb community users so that they don't go through tribulation.
    -- I put google ads and paypal donate buttons throughout the pages to test if iWeb is up for commercial challenge. I also tested how well the search and replace script worked. I have exemplified in macezzy website it is possible to use iWeb for business purpose. The script worked extremely well, it would have taken hours to insert google and paypal codes manually. Using the script it only took 10 min. I wanted to share that with other users who might wanted to do similar things. Sorry if that offend you, I will remove them.
    -- I never claimed to have created the script except the script that makes the first folder in documents folder. I did change the wording so that it is clear to users that they are switching sites(domain file). I did not create the awesome search and replace script either. I do mention that I have made the iWeb_ftpUpload automator.
    I have started macezzy site when iWeb was introduced and there wasn't much information about iWeb. I have and do try many things with iWeb and report to iWeb community users of things that I find helpful. I haven't made a dollar off the site and I have invested lot of my time because I like to see other users succeed.
    Powerbook G4 Ti   Mac OS X (10.4.4)  

Maybe you are looking for