shell script automator
Hello, I have this "odd mkdir line; ' MV * odd [13579] .jpg '.
I use it on terminal and it works, but if I try to take it on automator there is always a mistake.
Sorry for my ignorance, what is the problem?
Hi pietrod77,
delete 'cat' at the beginning of the command of automator.
Must be identical to that of Terminal: mkdir odd; MV * odd [13579] .jpg
Hope this helps
At soon dwbrecovery
Tags: iOS Developer
Similar Questions
-
Get the progress and result of a shell script
Hello
I would use a shell script to convert MP3 / audio FLAC files MP3 files with a bitrate of 192kbs and do other things in Automator or AppleScript script.
So I installed lame and flac with brew, run an Automator process with a selected file and perform an action of AppleScrip:
on run {input, parameters} if input is not {} then repeat with theFile in input set posix_file to POSIX path of theFile if input is not {} then tell application "Terminal" set thescript to "/usr/local/bin/lame -b 192 \"" & posix_file & "\" " do script thescript end tell end if end repeat end if return input end run
The Terminal window is there because you tell the Terminal to run your script - try using shell script.
-
Hi all
I have oracle DB in Amazon EC2. This DB will go down and I have to make every day.
I want to write a shell script that checks the State of the DB and do.
The things I do is
Log in as root
Su - oracle
sqlplus
user name:
PWD:
If DB is down, it shows error.
So I'll do it again
Log in as root
. / stopPageview
Su - oracle
sqlplus
user name: sys as sysdba
PWD:
the judgment
startup
output
output
. / startPageview
How automatically using shell script?
Published by: 969707 on January 9, 2013 04:36#! / bin/bash
#
# /etc/init.d/oracledb
#
# Startup script execution for the Oracle Listener and instance level
# It relies on information on/etc/oratab# These are the paths for our basic installation
export ORACLE_BASE = / opt/oracle
export ORACLE_HOME=/opt/oracle/product/11.1.0/db_1
Export ORACLE_OWNR = oracle
export PATH = $PATH: $ORACLE_HOME/binIf [! f $ORACLE_HOME/bin/dbstart - o! d $ORACLE_HOME]
then
echo "Oracle startup: cannot start.
Output 1
FIcase '$1' in
implementation)
# Start a listener and oracle instance
echo - n "starting from Oracle:
known $ORACLE_OWNR - c "start ORACLE_HOME/bin/lsnrctl $".
known $ORACLE_OWNR-c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME.
touch/var/lock/oracle
echo 'OK '.
;;
stop)
# Stop listener and oracle instance
echo - n "" shutdown Oracle: "."
"judgment of $ORACLE_HOME/bin/lsnrctl" known $ORACLE_OWNR - c
known $ORACLE_OWNR-c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME.
RM-f/var/lock/oracle
echo 'OK '.
;;
reload | restart)
$0 stop
starting at $ 0
;;
*)
echo "use:" basename $0' start | stop | restart | reload. "
Output 1
ESACExit 0
also use link below to create start & stop the database...
http://www.Oracle-base.com/articles/Linux/automating-database-startup-and-shutdown-on-Linux.php
http://www.exzilla.NET/docs/instance/StartupNshutdownWithshell.php*****************************************
Best regards
Shishir Tekade.
My Blog: http://shishirtekade.blogspot.com -
Put 'do shell script' multi-line with comments
I would like to integrate a Bash in Applescript script, as it is on several lines with comments.
The only documentation useful, that I can find is tn2065, but as far as I can see, it does not say how.
What is the correct syntax?
Maybe I'm missing something, but you can just write your script bash as a text object and passing to the shell script:
game of longBashCommand to "# some relevant comments.
CD /somedir
/ bin/something - foobar
# one other comment here
/ bin/Gisèle
' # one other comment.
the shell script longBashCommand
The trickiest part is perhaps the need to escape some characters such as quotation marks in the command shell.
-
Script Automator for the DATE and TIME stamped record
Hi all
I'm not a scripter, but are in need of a DATE and time-STAMPED folder (or file) I would like to put on my desktop and have updated automatically so that I can use this tool to quickly see if a backup external (or internal) is current. probably I could also use it to quickly find out how /old/ a backup is.
for now, I do this manually if I want to quickly verify that a backup works by creating a "date named folder" on the desktop - such as '-2016 03 26 "."» so I can quickly see if a backup I just ran ran.
I have a lot of backups (internal, external, off site, etc.) and it would be super useful for me to have.
I consider the name of the folder to be customizable (potentially) in case I need to change it, but a good default would be "-YEAR MONTH DAY" so that I could see easily when this backup has been but also I name my files in this way so they can appear in chronological order "."
is anyone able to help me with something like that or suggest another forum for cross-post this?
Thank you
Jon
Hello
Create the the ""new folder " action, like this:"
---------------
Drag and drop the 'Shell Script' variable in the "name:" field.
--------------
Double click on the variable in the "name:" field:
Copy and paste this text in the field 'Script ':
date "+%Y %m %d"
-
I'm on Mac OS X 10.11.2 and have problems with AppleScript and shell scripting.
The following script is a cutting of a larger project:
Tell application "Finder".
the value the_MePath (path for me)
the value the_MeCont (the_MePath container) as string
tell the end
the value of the_MeCont (text 1 thru-2) the_MeContShell
-normally isn't here!
the value the_MePara (the_MeCont & "STH - C Para WAV_48k_24.txt")
the value the_Parameters (opening for access file the_MePara with permission to write)
write ("WAV\r24\r48000\r48k\r") the_Parameters
Close access the_Parameters
-normally isn't here!
-destined to be there!
-the value the_MePara (shell script 'find' & city form the_MeContShell POSIX path & "-iname" "Para STH - C *'")
the value the_Parameters (opening for access file the_MePara)
the value the_ParaList (read the the_MePara file)
Close access the_Parameters
paragraph 1 of the value userFormat the_ParaList
paragraph 2 of the the_ParaList the value userBitDepth
paragraph 3 of the the_ParaList the value userSampleRate
paragraph 4 of the the_ParaList the value shortSampleRate
The lines between the "-normally isn't there!"-lines fills a file in the directory of the AppleScript with the data.
So now the file is there.
If I remove these lines and enable the line below "-intended to be here! ', the shell should find this file.
What I get, then, is a mistake:
"Fehler beim Zugriff auf das Netzwerk." error number - 5000 file "/ users/shared/_AppleScript development/_Archiv Sniplets/STH-C Para WAV_48k_24.txt" to "class fsrf".
to "open for access file the_MePara.
Any ideas, anyone?
Kind regards...
... Maik
Hello
Remove the end of file before the_MePara.
the_MePara contains a posix path type path--> "/ users/shared/_AppleScript development/_Archiv Sniplets/STH-C Para WAV_48k_24.txt.
You can use the file on the path of type HFS --> ' StartupDiskName:Users: shared: _AppleScript development: _Archiv Sniplets:STH - C Para WAV_48k_24.txt.
Information:
The script didn't need to open and close the access when the script to read-only.
Use this line only--> the value the_ParaList to read the_MePara
-
Insert a record, call a stored procedure and execute a shell script
Hello
I am trying to build a page APEX do these three things in order.
#1. Insert a new record in a database table (pk, donnees_xml, attr1 and attr2, etc.) and download the XML file to the donnees_xml column
#2. Save this XML file on a file system
#3. Parse the XML file on a file system and update the database with the parsed data table
I can do #1 with a regular shape based on the database table. I can do #2 with a stored procedure.
I can do #3 with a shell script.
I wonder how these tasks can be combined into a single action in APEX.
do #1;
If successful, do #2;
If successful, do #3;
I'd appreciate comments on this.
Thank you
Define a process of PL/SQL page submit that runs after the record is inserted, if P1_FILE is not null.
-
import program does not process customized when you use the shell script
Hello
I have the pkg in that
PROC1 without leaving param in this procedure, I call you created proc2 import and program
Now, I call this proc1 in the shell script, here my flat program to import does not work
Why? and I try to use CONSCUB on proc1 using 2 output param which is errbuf, retcode in the newspaper, I'm "wrong number of arguments"
Please help me?
Thank you
Renon,
Proc1 is your first program at the same time, right?
How many parameters is defined for that?
You can paste a screenshot of the window parameter?
If there is no parameter, just use this:
$FND_TOP/bin/CONCSUB $LOGIN SQLAP 'Accounts payable Manager' WAIT ' rajesh' = N SIMULTANEOUS SQLAP PROC1
Assuming that "Renon" is a username of fnd and the program is set in the Application of accounts payable.
See you soon
AJ
-
The work of the Disqualification of Linux Shell Script
Hello
We are the 11.1.1.7.3 with Weblogic Web server and Linux App Server Disqualification.
I want to know how we can carry out the work of the Disqualification of the Linux and write these commands in the shell script.
(1) present the task (run)
(2) check the employment status to see if the work is in working condition or supplement
I know that on Windows, it utility jmxtools.jar of command line operations in dnDirector/Tools folder. But I'm not able to find the jmxtools.jar file in one of the edq.home or edq.local.home of the directories under Linux install.
Can you guide me to the location where the jmx utility will be available under Linux and also the command to check the status of the job?
Thank you
Ravi
It's him!
Jobs called via the command line interface return an exit status when finished.
Monitor the precise status of the long-term work requires the use of the server of the Disqualification Console user interface.
-
Call Shell Script from within PL/SQL - using DBMS_PIPE
Hi all
I'm trying to run a shell script inside my PL/SQL using DBMS_PIPE block (not sure if this is the right way or not)
Pl Sql script
==========
Set serveroutput size 100000
declare
cursor c1 is select * from mag_images
where nom_image like '% comp2.
v_path varchar2 (100): = ' / home/maguzzi/DOCUMENTS_DIR / ";
v_result number: = 0;
v_in_filename varchar2 (100): = v_path | ' test_file.jpg';
v_out_filename varchar2 (100): = v_path | ' test_file_out.jpg';
v_script varchar2 (100): = "tst_convert.sh";
v_command varchar2 (200): = 'sh'. v_path | v_script | » '|| v_in_filename | » '|| v_out_filename;
Start
A1 to c1 loop
dbms_output.put_line ('v_command: ' | v_command);
write_to_file ('test_file.jpg', 'DOCUMENTS_DIR', a1. Content);
dbms_output.put_line (' file write result: ' | v_result);
v_result: = exec_host_command (v_command);
dbms_output.put_line (' resize result :'|| file v_result);
end loop;
end;
Result DBMS_OUTPUT
====================
v_command: /home/maguzzi/DOCUMENTS_DIR/tst_convert.sh test_file.jpg test_file_out.jpg
Result of the entry of the file: 0
Result of resizing the file: 0
PL/SQL procedure successfully completed.
Function exec_host_command
=======================
FUNCTION to CREATE or REPLACE exec_host_command (lc_cmd IN VARCHAR2)
RETURN INTEGER IS
ln_status NUMBER;
lc_errormsg VARCHAR2 (80);
lc_pipe_name VARCHAR2 (30);
BEGIN
lc_pipe_name: = 'Maguzzi_PIPE ';
DBMS_PIPE. PACK_MESSAGE (lc_cmd);
ln_status: = dbms_pipe.send_message (lc_pipe_name);
RETURN ln_status;
END;
/
The Image of the BLOB is written to the correct location on the server "test_file.jpg", and although the exec_host_command function returns a value of 0, the shell script (tst_convert.sh) is not executed (i.e. no output file is created - outfile.txt and the image is not copied/converted to a new file name "" test_file_out.jpg" )
Shell script
========
tst_convert.sh
echo 'Here' > outfile.txt
Echo $1 > > outfile.txt
Echo $2 > > outfile.txt
resizing to convert $1 - $200 2
Could this be problems with permissions on files?
test_file1.jpg has permission - rw-rw-r-
test_convert.sh a permission rwxrwxrwx
When I run the script manually and pass in 2 parameters ($1 = infilename and $2 = outfilename), it works...
I'd appreciate if someone can point out my mistake or suggest another method that works.
Thanks in advance
How long does it take to create the converted file? Remember that the external Scheduler is running asynchronously, so it is possible that the converted file does not exist yet when the PL/SQL block subsequently tries to open it.
Try to add some delay seconds to the routine to ensure that the external task is completed:
begin dbms_scheduler.create_job( job_name => 'MAG_IMAGE_CONVERT2' , job_type => 'EXECUTABLE' , job_action => '/home/oracle/DOCUMENTS_DIR/tst_convert2.sh' );-- '/home/oracle/DOCUMENTS_DIR/tst_convert.sh'); dbms_scheduler.enable('MAG_IMAGE_CONVERT2'); dbms_lock.sleep(3); end;
This probably isn't really a viable solution in the long term if it turns out that this is really the problem.
-
will not appear sql statemnt in shell script
Hello
I have a shell script with an unfavourable sql she calls another script where I connect to dabase.
In the journal of the script, I see the sql statement and I wish that that do not show me anything. How I make these?
Thank you
Hello
2650697 wrote:
Hello
I have a shell script with an unfavourable sql she calls another script where I connect to dabase.
In the journal of the script, I see the sql statement and I wish that that do not show me anything. How I make these?
Thank you
Your postal code. It is very difficult to tell what you're doing wrong without knowing what you are doing.
You can have SQL statements directly in your shell script. They must be in a script by themselves, said fubar.sql, and shell script must contain
@fubar
instead of real SQL statements.
-
Re: Unix shell script to notify if an array has reached a number of lines
Looking to write a script to send an alert notification when an Oracle database table object reaches a certain value of line number. If anyone has the logic "If this while" for a script shell unix would be great.
With the logic of control and check on the table when it reaches the total line number can be added to the script and on-demand via cron.
Thank you.
Thus, you must periodically (how often?) a COUNT (*) on the target table? Is this acceptable overhead?
/Korn Bourne shell scripts can compare numbers and check if one is greater than another. See "-gt" UNIX - Shell basic operators
Hemant K Collette
-
Using the shell script sql variable
OS: Oracle Linux 5.10
DB Oracle 11.2.0
I have need to query the database and assign the return value to a variable of shell, but it does not work.
create table imr_env (key varchar2(1000), value varchar2(1000) ; insert into imr_env values('TblspcUsagePct','90'); commit;
Here is the shell script:
#!/bin/bash echo "in script" ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 ; export ORACLE_HOME ORACLE_SID=IMR1 ; export ORACLE_SID export PATH=$PATH:$ORACLE_HOME/bin pct=`sqlplus -S app/manager <<END set serveroutput on declare output_val number ; BEGIN select value into output_val from imr_env where key = 'TblspcUsagePct' ; dbms_output.put_line('output_val: ' || to_char(output_val)) ; END ; / exit; END` ## another sqlplus connection, use $pct in the where clause echo "var value is $pct"
Here is the result:
SQL> ./test.sh in script var value is output_val: 90
Why isn't the shell variable is populated with the value retrieved from the database?
I need to use $pct in another query that will be storage spaces that are at least 90% full.
I had to change to a korn shell - I couldn't get the "READ" command in shell or bash.
But it is not only "READ" command:
SQL > select * from IMR_ENV;
THE KEY VALUE
------------------------- -----
TblspcWarningLimit 90
TblspcUsagePct 50
SQL > exit
Disconnected from the database to Oracle 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
With partitioning, OLAP, Data Mining and Real Application Testing options
$ cat test.sh
VAL = $(sqlplus-S test/test)<>
Set feedback off
set the position
Select (value) from imr_env, including the key to_number = "TblspcUsagePct";
Select (value) from imr_env, including the key to_number = "TblspcWarningLimit";
"exit";
EXPRESSIONS OF FOLKLORE
)
set $VAL
Echo $1
Echo $2
$./test.sh
50
90
$ echo $SHELL
/ bin/bash
$
-
Shell script error: EXPECTED integer
Hello
I have a shell script:
If test $#-No 3
then
echo "error: Incorrect number of parameters.
echo "use: install.sh fist_day_of_the_month user pass.
ECHO «»
Output 1
FI
#pas 1
sqlplus-s $2 / $3 @pas1.sql $1 > > $0.log;
#verificare lame date
User = $2
passdb = $3
get_Count () {}
sqlplus-s ${user} / ${passdb} < <!
set the position
Set feedback off
set pages 0
SELECT COUNT (TI. CUSTOMERID)
OF MBTIBUSER. TEMP_IB TI, MBTIBUSER. TEMP_MB TM
WHERE TI. CUSTOMERID = TM. CUSTOMERID
AND TI. REGULARFEEFORIB_AC IS NULL
OR TI. INITIALFEEFORIB_AC IS NULL
OR TM. INITIALFEEFORMOBILE_AC IS NULL
OR TM. REGULARFEEFORMOBILE_AC IS NULL
Group 1;
!
}
Count = $(get_Count)
echo $count
If ["$count" - gt 0]; then
echo ' STOP! "Nu exista curs valutar pentru ultima zi a lunii of billing.
sqlplus-s $2 / $3 @STOP.sql > > $0.log;
on the other
echo 'OK '.
FI
I got the error "'integer should ' on the line: If ["$count"- gt 0];" then
Do you have any ideeas?
Thank you
Claudiu
I got the error "whole expression should" on the line: If ["$count" - gt 0]; then
Remove the quotes from $count
If [$count - gt 0]; then
-
Hi all
I'm trying my hands on scripting in OBIEE. I wrote following script
#!/bin/bash export PATH=$PATH::$HOME/bin:/u01/app/oracle/obiee117g/instances/instance1/bin . /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl status
When I run this script. I get the following error.
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 25: =: command not found /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 26: =: command not found /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 28: syntax error near unexpected token `(' /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 28: `%commands = ('
What Miss me?
Thank you
V
TL; DR: this point on the third line of your script is redundant and the origin of the problem. Run this instead:
/u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl status
Also, since you are using the absolute path (that is the full path to opmnctl, starting with a /) setting the environment variable PATH is redundant.
Explanation:
The dot is a shortcut for the command of the source , which has a different behavior to just run the script directly.
You use source when you are wanting to run a script to set the environment etc. variables (an example of this is the script of bi - init.sh, which implements the OBI environment to run utilities such as nqcmd).
If you open opmnctl itself, you will see that it is a perl script. The "shebang" on the first line tells linux to run the script using the perl interpreter, and I suppose when you are sourcing it Linux tries to pass under the shell running (bash) - and the perl language throws the bash syntax errors that you see
More information: executable - different ways to execute a shell script - Unix & Linux change battery source or dot operator Man Page. Bash | SS64.com
Maybe you are looking for
-
HP Envy Phoenix 810-160: hard drive crash?
Hello My desktop computer has been acting lately. Before start time allows to be very fast, but now is the time to start take much more time. Then when I want to start the computer, it looks like not detected media presence and try to start on the ne
-
Have comments & admin accounts on computer. Firefox works fine in admin acct, but in comments ACCT. It is not filling out forms correctly, for example by typing @ returns ', #. =, ^ = &, & = / and so on.» Problem is limited to special characters, num
-
Since my upgrade, I can't video call to work. No one can see me? On the other side if I use Face Time is Ok, the device works. If someone has an answer how solve it I would be grateful.
-
Hello (or whatever the hour, it's at your place) I want to display the data I get a 3 - axis acceleration sensor. I want to display 3 values on 3 blade of filling. Is it possible to rotate a fill of 45 ° slide? If Yes: how? Any help is appreciated
-
EA6350 2 weeks just stop working, power light only
I just bought an EA6350 less than 2 weeks ago and came home yesterday night with no network no internet. The main power light is on top, but that's all, there is no activity light flashes on any wired connections that are wired and the Ethernet of my