Unix scripting
Is there a way to create a script that will run Unix commands from a desktop icon/app?
Can it be done using Applescript?
If so how?
Paul,
If I understand your question(s) correctly, the answer to both of them is yes. You can create a shell script and save it with the extension ".command", e.g., MyScript.command. Make sure that it is executable. You should now be able to double click it and the process will run.
You can also use shell scripts in AppleScript. They take the form of:
do shell script "lp -d printerName /Users/me/foofile
For more information on this see the Apple Tech Note 2065.
Matt
Similar Messages
-
Executing Unix scripts from a stored procedure
From the sql*plus windows, I am able to execute the host command and '!sh' commands; but I need to ececute Unix scripts from a stored procedure. Hoe can I do this? Where can I get good documentation on this? Any help would be greatly appreciated!
Thanks..Hi,
U can use external procedure ( newly added feature in 8.0.3 onwards) and call any shared library. From shared library u can execute it.
One sql command is there HOST(' '). U can run a OS command. But u can not use it in PL/SQL.
U can call pls sql from shell !!!!!..
Thanks...
Boby Jose -
File port query File transfer from SAP R/3 to Webmethods using Unix Script
SAP drops the files in the /sapio/ directory and triggers an unix script using File port partner destination.
Unix script will perform a secure copy of files to Webmethods server.
If in unix script, error occurs then an RFC function will be called to send an error notification to a person.
Queries
1) How is the unix script triggered using the File port partner destination ?
2) What is the unix command to invoke a report which sends the error notification mail ?
3) Does SCP command to copy files to webmethods work , if the unix script is placed in /sapio/ directory ? Or whether
any connection need to be established between SAP and Webmethods server ?Hello,
Since you want to transfer Article Master, it should be a Retail System. So you should use Message Type ARTMAS. For fullbuild, you can use transaction WDBM and for changes, you can use WDBU. For changes, you can enable change pointers for required fields using BD64.
Thanks,
Venu -
Oracle BI Publisher 10.1.3.4-Can you execute a report via a unix script
Would like to know if its possible to run an OBI-Publisher report using a command line or a unix script instead of using the scheduler.
If so anyone have a sample of how to accomplish this...
Thanks in advance...
DSCheck these, use that forum for specific to BIP
Re: Run BI Publisher from the command line through a shell script
Is there a UNIX command line to export/import XML Publisher templates?
Ifhelps mark -
How can I run a Unix script from a desktop icon?
I have a Unix script I've created in vi and would like to run it by double clicking on an icon on my desktop. I would like to do this without the additional application layer of Applescript, Automator or Terminal. Is this possible?
Thanks in advance.
HowardSounds like a job for platypus.
-
How can I exit my UNIX script when my PLSQL script in it calls an error?
hello.
I hope someone can help with my error handling and exiting-in-the-right-place problem.
I have several PLSQL scripts that are called from a UNIX script to insert/update employee records in ORACLE Financials.
At the end of the UNIX script, depending on whether an entry has been created in the errors table should depend on whether the UNIX script stops or not. Trouble is, its stopping too early everytime even though the the record has been inserted correctly. Please can someone either advise on what I'm doing wrong or suggest an alternative..
This the end of the PLSQL script that inserts the entry into errors table if theres an error..
WHEN OTHERS THEN ROLLBACK;
err_msg := SUBSTR (SQLERRM, 1, 350);
insert into kpmg_error_check (concurrent_id,module,narrative,status,creation_date,created_by)
values(0,'TEMPLOYEE_DTLS.sql',err_msg,'ERROR',SYSDATE,'Feldman');
commit; This is the end of the UNIX script that looks at the table..
echo " "
echo "**** `date +%H:%M:%S` - Checking if TEMPLOYEE_DTLS.sql ran OK"
error_check=`sqlplus -s $user_id @$SU_TOP/sql/SUTEMPCHK.sql 1`
if `echo $error_check` -ge 1
then
# Load failed
echo " "
echo "**** `date +%H:%M:%S` - TEMPLOYEE_DTLS has failed - check table KPMG_ERROR_CHECK for details.."
exit 1
else
# Load finished OK, if input data file exists, move and rename it
echo " "
echo "**** `date +%H:%M:%S` - TEMPLOYEE_DTLS has finished OK.."
fiThis is the entire SUTEMPCHK.sql script that the UNIX script uses..
-- Check if any errors have occurred
SELECT count(1) FROM kpmg_error_check WHERE concurrent_id = &1
EXITIs it that the above is always returning '1' and so always thinks theres an entry in the errors table?
Is there an easier way?
many thanks,
StevenHi,
You have to iterate through all pages.marginPreferences:
var
myDocument = app.activeDocument,
allPagesMaPref = myDocument.pages.everyItem().marginPreferences,
curPageMaPref;
while ( curPageMaPref = allPagesMaPref.pop() )
with (curPageMaPref) {
columnCount = 1;
//columnGutter can be a number or a measurement string.
columnGutter = "0";
bottom = "0"
//When document.documentPreferences.facingPages == true,
//"left" means inside; "right" means outside.
left = "40"
right = "0"
top = "0"
inside = "0"
Jarek -
Error while executing UNIX script from BODS - exit code 127
I am trying to execute a unix script by calling it in BODS job. It is giving an error saying Program terminated with exit code 127. The same script when i am executing in UNIX it is working fine. I am unable to trace the issue.
Hi Sabre,
As per the guidelines provided by the article, i had done below changes..
InputStream is = null;
InputStreamReader iStreamReader = null;
BufferedReader bReader = null;
String line = null;
try{
String fileName ="test.ksh";
String argValue ="satish"; // value passed to the script
String exeParam = "/usr/bin/ksh "+fileName+" "+argValue;
Process proc = Runtime.getRuntime().exec(exeParam);
is = proc.getErrorStream();
iStreamReader = new InputStreamReader(is);
bReader = new BufferedReader(iStreamReader);
System.out.println("<ERROR>");
while((line = bReader.readLine()) != null)
System.out.println("Error is : "+line);
System.out.println("</ERROR>");
int exitValue = proc.waitFor();
sop("Exit Value is : "+exitValue);
catch(Exception e)
e.printStackTrace();
Now , it's showing something like..
<ERROR>
</ERROR> -
Running a Unix Script through a Java Program
Hi !!!!!!!!! Can anybody plz suggest me an approach for the following queries -
1. How to execute a unix script through a java program ?
2. How to send the o/p of the script to a java program so that it can be used .import java.io.*;
public RunScript
public static void main(String args[])
try
Process p = Runtime.getRuntime().exec("script.sh");
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null)
System.out.println(line);
input.close();
catch(Exception e)
e.printStackTrace(); -
Execute unix script from abap.
Hi friends,
I have a abap report which generate a text file in<b> /usr/tmp/</b> directory . Now i have a unix script which encript the text file. I want to this from abap report. How I can do this . and in which path I should keep this unix script Please help.
RegardsHi,
try the below code
parameters : p_sfile(60) lower case
"File to be moved
"Eg : /home/in/SFILE1.txt
p_dfile(60) lower case.
"File's Destination
"Eg: /home/archive/SFILE1.txt
data : t_btcxpm
like btcxpm occurs 0,
p_addparam
like sxpgcolist-parameters.
concatenate
'/home/ABAP/scripts/Archive_file.sh'
p_sfile
p_dfile
into p_addparam separated by space.
refresh t_btcxpm. clear t_btcxpm.
call function 'SXPG_CALL_SYSTEM'
exporting
commandname = 'ZSHELL'
additional_parameters = p_addparam
tables
exec_protocol = t_btcxpm
exceptions
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
program_start_error = 6
program_termination_error = 7
x_error = 8
parameter_expected = 9
too_many_parameters = 10
illegal_command = 11
others = 12.
if sy-subrc = 0.
write : /
'File',p_sfile,'moved to',p_dfile.
else.
write : / 'Error Occured'.
endif.
Reward points if found helpful
Cheers,
Chandra Sekhar. -
How to submit a batch compare job using a unix script and cron?
I understand I can setup a unix script to be used to schedule a database compare job. I'm not sure how to get past the popup log in window tho... When I use the command line and include the -id<myid> the OMS login window pops up requesting login password and service. This won't do if I do not want to run this interactive. I cannot find any syntax for the command line other than --id<adminid> How to I include the password and service?
Thanks ;)
LaurieI had the same problem.
My shell looks like (baseline_ELITE.sh):
ocm login -idsysman
ocm capture -l BL_ELITE -idsysman
I don't have the ocm logout.
First, run the baseline_ELITE.sh, it will ask you about the password. The next times, it never ask again for the password, but take in account don't use the ocm logout.
Humberto Gomez
OCP Dev2k, 8i, 9i
[email protected] -
Call ABAP program from Unix script passing dynamic filename
Hi,
Does anyone know if it is possible to call an ABAP program from a Unix script passing a dynamic filename to the ABAP program?
We are receiving a file from an external company and on receipt of the file want to call an ABAP program passing the filename. The filename is made up of File ID, Date and Time which we need to read in the ABAP program. We usually use Events to trigger a program which is fine when the filename if static however since this filename will be dynamic we cannot do this. In addition we cannot just rename the file to a static name in the Unix script as we need to know the value of the date and time from the file ID in the ABAP program. I can change the ABAP program to check our /in directory for a Filename that starts with the fixed File ID however I thought there must be a better way of doing this. We want the external company to put this information in a file header record but they don't want to change the file contents. Any ideas would be appreciated.
Thanks,
Sinead.You could follow the following method
1.Let the external file reside in the SAP application layer in a defined path e.g. /usr/sap/tmp/interface/working/
2.Write an ABAP program which will include the following steps:-
i) read all files in the file path using function module EPS_GET_DIRECTORY_LISTING
ii) Read the data from files existing in the directory using OPEN_DATASET statement
iii) After the files have been read move the files to another directory e.g. /usr/sap/tmp/interface/backup/ or you can delete the file.
3.Schedule this program to be executed depending on the frequency of the external file being generated. -
How to pass process flow input parameter to unix script external process
Hi,
I'm trying to pass a process flow input paramter (string) to an external process which is a unix script. I've been working on this for the last 2 days but can't get it to work. Here is the design. I have a process flow with 3 maps that create a file in the unix file system. I have a suffix, which is an input parameter to the process flow, that will need to be passed to the unix script to rename the file appending the suffix to the filename. I've tried different things and nothing works for me. Has anyone done something similar in OWB?
Thanks much!I tried using useBean inside the Jsp for this.
But following error comes:
OracleJSP error: oracle.jsp.parse.JavaCodeException: Line # 13, oracle.jsp.parse.JspParseTagExpression@102e37e
Error: Java code in jsp source files is not allowed in ojsp.next mode.
Please explain why?
How can set POST request params when calling to an external servlet? -
Execute UNIX script from java not working
Hi
I am having difficulty running my java program to execute UNIX script on a Windows box. Here is my code.
public boolean executeScript() {
try {
String testScript= "WEB-INF/scripts/test.sh";
File file = new File(copyToQaScript);
System.out.println(file.getAbsolutePath());
Process proc = Runtime.getRuntime().exec(file.getAbsolutePath());
} catch (IOException ioe) {
ioe.printStackTrace();
logger.error(ioe);
} catch (RuntimeException re) {
re.printStackTrace();
logger.error(re);
} catch (Exception e) {
e.printStackTrace();
logger.error(e);
return true;
}When I execute this method, I am getting IOException as below.
java.io.IOException: CreateProcess: C:\tomcat-5.0.28\webapps\myProject\WEB-INF\scripts\test.sh error=193
Can anyone help me? Thanks.kminkeller wrote:
Yes I have Cygwin installed. I am quite aware of that thanks Sabre.Then you need something like
String[] command = {"bash","/home/sabre/bin/fred.sh"};
Process p = Runtime.getRuntime().exec(command);
if the executabe directory (/home/sabre/bin in my case) is not on the PATH or
String[] command = {"bash","fred.sh"};
Process p = Runtime.getRuntime().exec(command);
if it is. -
Unix SCRIPT CALL FROM PL/SQL
How can I call an unix script from a PL procedure ?
http://www.orafaq.com/scripts/c_src/extproc.txt
-
Changing the filenames using unix script
Hi,
I have a scenario where I have to change the file names on the Receiver CC using a unix script and add date and timestamp to the file name
this is what I'll be writing to filename_01.xml I need to change that to newfilename_01_MMDDYYYY_HHMISS.xml
the 01 in the file name is the counter, so I might having more than one file where 01,02, etc will represent the counter on the filename.
Any help is really appreciated.
Thanks,
Joe.Pyou can try this
create the field called filename in target
use a costant and concat it with the out out of UDF( or some functon avaleiable counter) which will genereate numbers like 1,2,3,4,5,6 and send this filename_01 to the output field and use this in the variable substution to genreate the filename by the CC
if you dnt want to send this fieldin output file then specify that fieldname in CC length as 0 -
Catching System.Exit(value) in a unix script
I am migrating a java application from Windows to Unix, where on the Unix environment it will be run under a batch scheduler.
I am trying to figure out how to get Unix script 'visibility' to the contents of system.exit().
At program completion, system.exit is called with either a 0 (all's cool) or -1 (this dog won't hunt).
I cannot figure out how to get that value communicated back to the invoking script, which currently looks something like:
cp=<classpath>
rm -f /staging/*
$JAVA_HOME/bin/java ........
rc=$?
<if 'rc' = 0>
{ :perform this }
<if 'rc' = -1>
{ :perform this instead }
Any suggestions?rc=$? suggests it's Bourne shell you're running the script with?
if [ $rc .eq. 0 ]; then
echo "Bingo!"
else
echo "Oh shit..."
fi
Better yet, do "man sh" from a unix command prompt -- it gives you the full scoop.
Maybe you are looking for
-
Wiki directories not being created for groups
I am trying to get the wiki service working for a few groups on my 10.5 server and not having much luck with it. I've enabled the wiki and blog services in Workgroup Manager for three of the groups on my server, but only one of them seems to have the
-
ITunes no more starting up on XP
Hi to evertbody. I have a Portable PC with Windows XP on it and everything has always worked fine. Now, since a couple o weeks, whenever I launch iTunes (especially for my iPhone syncs) I get a generic error message. I deleted iTunes via its Installe
-
A continuous bug in Flash CS5 and CS5.5
When you creating a classic-tween and you add an ease to it using the ease editor – it works fine, BUT! If you want to insert a keyframe inside that tween range it totally messes the spacing! It's a tremendous bug which keeping me and many other anim
-
Error: C compiler cannot create executables
Install ctags-5.7 ~ ./configure Error Error Message:checking for C compiler default output file name... configure: error: C compiler cannot create executables config.log: This file contains any messages produced by compilers while running configure,
-
2 Facts with common dimensions
Hi All, I am trying to developer an Answer I have two Fact tables :- Budgets and Actuals The two Fact Tables have common dimensions (Period, Cost Centre and Expense) When I create an answer which combines these common dimensions and the two fact tabl