Terminal is trying to auto-execute a shell script
I can no longer use Terminal because every time I try to start it, it automatically runs a shell script I used to have on my desktop and then immediately says "[Process Completed]." I'm not sure how exactly I got it to do this... as far as I know all I did was execute the shell script by associating it with Terminal and double clicking it... but now I can't create a new shell without it automatically attempting to execute it. Please help!
Thanks,
Michael
nevermind... found this http://www.starglider.net/MacOS_X/Terminal-ExecutionString.html
Apparently I'm not the only one who's made this incredibly aggravating mistake
Similar Messages
-
Error while executing unix shell script from java program
Hi All,
I am trying to execute unix shell script from a java program using Runtime.execute() method by passing script name and additional arguments.
Code snippet :
Java Class :
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);
int exitValue = proc.waitFor();
sop("Exit Value is : "+exitValue);
catch(Exception e)
e.printStackTrace();
}Test.ksh
export -- application realated paths..
nohup abc.exe 1> test.log 2>&1;
$1
exit.By running the above java class , i am getting exit Value: 139 and log file test.log of 0 bytes.
when i am running the same command (/usr/bin/ksh test.ksh satish) manually, it's calling abc.exe file successfully
and able generate the logs properly.
Pls let us know where exactly i am stuck..
Thanks in advance,
Regards,
SatishHi 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> -
CSS 11500 - Keepalive script to remotely execute a shell script on a server
Hi!
I've been trying to connect the dots but so far I've got nothing close to what I need - based on Cisco's documentation.
I was wondering if it was possible for the CSS switch to connect to a server in order to execute a shell script such as "/opt/whatever/script.sh", which would return a specific value like "OK". Anything different than OK would mean a dead service, and the affected service would be taken out of business (no load balancing play).
Could someone confirm whether it can be done?
Many thanks!!
LeoLeo,
you could try to use CSS script to telnet to the server, and execute the command.
But that would be ugly.
What you should do, is put your script inside a cgi webpage and let the CSS call the webpage.
Your webserver will then run the script that you want and return to result inside and HTML page to the CSS which can then decide on the status of the server.
If you do not have a web server, you should create a small tcp server to listen to CSS request and again send the result of the script back to css.
Gilles. -
Privilege problem on DBMS_SCHEDULER execute linux shell script
Hello, everybody,
I'm a beginner on oracle development , recently , I use DBMS_SCHEDULER to execute linux shell script so that I can transmit files to another ftp server . The problem is , I can't use ordinary user to execute this shell ,but must use sys user , or the procedure will show error : Permission Denied;
I can't change the files' privillege that need to transmit.
I had tried these method,but no use:
1. grant all privillege to user;
2. change the privillege of shell and it's direcotry;
3. use full path in shell;
I hope someone could help me solve this problem , thank you!
the error code :
STANDARD_ERROR="ftp: local: test20121221173852: Permission denied
ftp: local: test20121221173953: Permission denied
ftp: local: test20121221174052: Permission denied
ftp: local: test20121221174153: Permission denied"My /tmp/test.ksh trying to find database status.
. ~oracle/.profile > /dev/null
db_status=`eval sqlplus -s 'system/passwd@DEV' << EOF
set pagesize 0 feedback off verify off heading off echo off
select status from v\\$instance;
exit
EOF`
echo $db_status > /tmp/db_status_out -
Execute process (shell script) under different user
Hi,
is it possible to use the ProcessBuilder oder .exec()-method to execute a shell script under a JVM-different user? I need to start shell scripts for different system users and I don't want to use SUDO or a wrapper script to switch to the required user. I would like to define the user at java level. Is this possible?
Best regards,
Thomaslooking for something like this too.
currently i am relying on a script in which i have to set the user as:
"su username -c java_program"
the problem with this approach is that if youre not running as root, then su asks for a password, thereby halting execution. (tried input redirects and here-docs, (some popular linux tricks), they did not work)
so you have to be root for the script option to work.
if anyone can suggest a more "java based" way of executing a process as a different user , thatll be awesome. -
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! -
Executing a shell script from a jsp page
Hi,
I'm facing a problem while executing a shell script from a jsp page.
I'm using Runtime.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() like RMI etc,.If so let me know.
Thanks in advance.Hello,
It's hard to help you but what you can do is listening to the outputs of your script, you should read the output stream and error stream and send them to the default console.
Check this excellent article : http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4
Best regards,
Olivier. -
How to execute unix shell script from Java ...
Hi,
Anyone know how to execute unix shell script from Java?
Suppose I have several shell scripts written in perl or tcl or bash.
I just want to catch the output of that script.
Is there any ready to use module/object for this?
Please let me know, this is quite urgent for my study assigment.
Thanks in advance,
Regards,
meLook up Runtime.exec()
-
How to execute unix shell script in webdynpro?
hi all,
We have some iquirement of executing script in unix.If anyone know How to execute unix shell script in webdynpro?
best regard
reefishRee,
1. Find SSH client for windows, then execute SSH with Runtime.exec() on local host with arguments like remote host, auth, command to execute etc.
2. Get SSH client in Java and execute SSH commands on remote host using pure Java API.
Don't ask me for links, Google works today, I checked this
Valery Silaev
SaM Solutions
http://www.sam-solutions.net -
How to execute a shell script?
Hi,
could someone please tell me the correct way to execute a shell script? For example run.sh located in my resources?
Thanx in advance!Odds are good that Apple doesn't want you running shell scripts on an iPhone, but somebody else might have information to the contrary.
-
Executing a shell script with DBMS_SCHEDULER
Hi,
when I execute a shell script with DBMS_SCHEDULER this doesn't works correctly
BEGIN
DBMS_SCHEDULER.create_job
job_name => 'job_AR',
job_type => 'EXECUTABLE',
job_action => '/home/crm/crmdw/AR/start_execution.sh',
enabled => TRUE,
start_date => systimestamp,
repeat_interval => 'FREQ=MINUTELY;INTERVAL=15',
comments => 'Test Job AR'
END;Inside the shell script there is a code who call a Hierarchy of process,
if I executed it manually or with a cron, it works perfectly
but when I execute it with the job that I've described before it's executes
all process at same time and it doesn't work.
What can I do to fix the issue,
any Ideas?
Thanks in advanced...#!/usr/bin/ksh
#test_dbms_scheduler.ksh
echo $1
echo "I am in Unix"
exit 0
chmod 755 test_dbms_scheduler.ksh
Create or replace procedure test_dbms_scheduler
as
v_text varchar2(255) := 'Parameter passed from Oracle to Unix';
Begin
dbms_output.put_line("I am in Procedure");
dbms_scheduler.create_job
(job_name=>'test_dbms_scheduler',
job_action=>'/usr/bin/test_dbms_scheduler.ksh',
number_of_arguments=>1,
job_type=>'executable',
start_date => SYSDATE,
repeat_interval => 'FREQ=SECONDLY; INTERVAL=1',
enabled=>false,
auto_drop => TRUE,
comments=> 'Run shell-script test_dbms_scheduler.ksh');
dbms_scheduler.set_job_argument_value(job_name =>'test_dbms_scheduler', argument_position => 1, argument_value => v_text);
dbms_scheduler.enable('test_dbms_scheduler');
dbms_output.put_line("I am back in Procedure");
Exception
when others then
dbms_output.put_line(sqlcode||sqlerrm);
end;
set serveroutput on
exec test_dbms_scheduler; -
Executing Unix shell scripts with DBMS_SCHEDULER
I have the following Unix shell script create_backup_file.sh:
#!/usr/bin/ksh
/usr/bin/ssh [email protected] /usr/bin/touch/app_home/home/trotestbat/scripts/TRO_batch_complete_`date +%d-%m-%Y-%H%M`
If I execute this from the command prompt it creates the file on the remote server.
I've used dbms_scheduler to try and execute this from Oracle:
BEGIN
SYS.DBMS_SCHEDULER.CREATE_PROGRAM
program_name => 'CREATE_TRO_BACKUP_FILE'
,program_type => 'EXECUTABLE'
,program_action => '/APP/TORPEDO/DTE/SCRIPTS/create_backup_file_tro.sh'
,number_of_arguments => 0
,enabled => TRUE
,comments => NULL
SYS.DBMS_SCHEDULER.CREATE_JOB
job_name => 'DTE.TESTAGAIN'
,start_date => TO_TIMESTAMP_TZ('2010/05/17 16:09:24.710789 +01:00','yyyy/mm/dd
hh24:mi:ss.ff tzh:tzm')
,repeat_interval => NULL
,end_date => NULL
,program_name => 'DTE.CREATE_TRO_BACKUP_FILE'
,comments => NULL
END;
The problem I have is that scheduler executes the shell script and creates the file but it never completes the job. The status of the job is permanently 'RUNNING'. Why is the scheduler not returning a completed status?the "infinite" script is usually caused by a prompt (script pauses for a user input).
Please keep in mind that executing script via scheduler is not the same as manually via prompt.
1. the script runs as ORACLE user ID (or whatever you specified using DBMS_SCHEDULER.create_credential or/and "$ORACLE_HOME/rdbms/admin/externaljob.ora")
2. the environment variables are probably not the same.
My wild guess is that you never ran SSH using "oracle" UID and thus it prompts for permission to add the remote computer’s fingerprint to the user’s ~/.ssh/known_hosts file - since it is a script, it just hangs and waits for input.
Did you try to login to unix box as oracle uid and run the script manually? -
How we can call or execute a SHELL script through Oracle forms or Reports
How we can call or execute a SHELL script through Oracle forms or Reports.Its urgent.......
Use HOST command.
-
Executing a shell script from a form (client / server)
From a form in a client server environment, I would like to execute a shell script on the server.
Environment:
Server: SunOS 5.6
DB : 8.0.5
Forms : Developer 6 w/patch 6A
Forms - 6.0.5.34.0Jim,
Yes. Use the host command from forms and call the command rexec.
Raymond
null -
Executing a shell script from a web deployed form
Hi there,
i've got a web deployed form from which i want to execute a UNIX shell script upon clicking a button.. I've used the host command ,and the rsh utility in Windows NT but i'm getting an error message saying
"machine address" Permission denied, rsh can't establish connection " this is the code in the when button pressed trigger
HOST('c:\windows\system32\rsh <<machine address>> opt/apps/wmc/rw.ksh');
the machine address being the unix machine i'm trying to connect to and the last part being the path and the shell script to be executed..
can anybody help me out here ????
Regards
wole
nullJim,
Yes. Use the host command from forms and call the command rexec.
Raymond
null
Maybe you are looking for
-
Also will the apps that I have not bought with my money from App Store but just downloaded, can I still upgrade them? And what about if I have some music and apps which were not brought from my iPhone 5c which I am currently using, but from my old i
-
How do i save a file in its original size?
Photoshop automatically scales my large files to 8-12% giving me lower print quality.
-
File Info not saved (.gif) (Ps CS6 Extended, Mac)
I'm not certain that I've been building my workflow properly before, so if this was not supposed to be supported, I'm open to that possibility: Modifying the "file info" for a gif file (in my case, "General" tab, "Document Title" and "Description") d
-
Problem compiling file through Runtime.exec
Hi all, I execute the following code : Runtime r = Runtime.getRuntime() Process p = r.exec("javac /home/test/temp dir/helloworld.java"); The command i give has a directory with space ("temp dir"). Iam not able to run the above code in Linux. Kindly h
-
Hallo! Some days ago, i made a small programm, which is able to read *.txt files and list it out! Now i am trying to sort this list ( by age or name). I think it�s possible with the "compareTo" Methode. But i don�t no how? Please give me some tips! T