Using fsch inside a shell script?
I like the premise of using fsch because build times are
greatly reduced. However, I want to integrate fsch better into a
more automated build system, even Ant. Anyone know how to do this?
BTW, I'm using a Unix based system: Mac OS X. I guress I'd like to
be able to call something more like 'fsch mxmlc .....'
I have played with the Flex apache module of Flex 3 but
ultimately want any build error to appear back in my text editor
inside of inside the browser. So I have the apache module working
well but am now trying to get fcsh to work inside a shell script as
a single call - how do I call out to the running process?
Thanks,
Phil
You could do:
if [ ! -z "`echo ${F1} | grep "ABC"`" ] then
fi
Similar Messages
-
Trying to run program off network location using GPO with Power shell script.
Hello All,
Not much of a script writer. I am giving it a shot. My issue is that I need to run a application update across our network and I am trying to do it with as little hands on as possible. So I was planning to push a GPO with a power shell script in it
to run the program with elevated privileges.
Little background:
We are running on a domain and end users do not have admin rights.
The application is stored on a share on our network that is open to all domain users.
The installer user name and password is a temp one and will only be valid for the 30 min window when everyone logs in at the beginning of the day.
So this is what I have so far.
$username = "USER"
$password = "PASSWORD"
$credentials = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
Start-Process PSQLv11Patch_Client_x86.msp -Credential ($credentials) -WorkingDirectory \\Server\Folder\Folder1\Folder2\filder3\PSQLv11sp3_x32\
But for some reason I keep getting :
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At line:10 char:1
+ Start-Process PSQLv11Patch_Client_x86.msp -Credential ($credentials) -WorkingDir ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
Any help you could give would be great.
Thanks,
jdfmonkeyHi jdfmonkey,
Has anyone provided an answer to your original question? I am trying to use Start-Process to launch a process using another logged in user's credentials, and am not able to get it working:
$cred=Get-Credential
start-process Process.exe-WorkingDirectoryC:\Scripts-Credential$cred
I get the same error that you mentioned:
start-process : This command cannot be run due to the error: The system cannot find the file specified.
At C:\Scripts\Process.ps1:2 char:1
+ start-process Process.exe -WorkingDirectory C:\Scripts -Credential ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
When I leave off the credentials:
start-processProcess.exe-WorkingDirectoryC:\Scripts
It works correctly. Does anyone have a solution to make this work correctly?
Please ask your own question. You issue is nothing like the current thread. You clearly are using a user account that has no access to the folder. It is a permissions issue. It is not a scripting issue.
If you need further help please start your own question.
¯\_(ツ)_/¯ -
hi all ,
can anyone explain me this script particularly why expect is used here.
set timeout -1
spawn sftp [email protected]
match_max 100000
expect -exact "Connecting to 11.11.1.34...\r
sftp> "
send -- "cd /opt/app/policies/data\r"
expect -exact "cd /opt/app/policies/data\r
sftp> "
send -- "get potcontrol.dat\r""expect" is a particularly useful scripting tool when you need to make a script that performs an interactive, multi-command dialog with another utility, like FTP or SFTP (or in the olden days, I used it a lot with Kermit).
In your example, "expect" is being used to launch the sftp client to connect to some sftp server, switch to a certain directory and then fetch a copy of a certain datafile, all while expecting precise return strings coming back from the sftp client.
Certain tools and apps, like ftp, sftp and others, cannot be simply scripted via ordinary shell script methods to feed strings of commands to those tools and apps, because of unusual ways in which they open up their own separate /dev/tty to interact with the command line user, hence "expect" was created and is very useful for scripting dialogs with such tools and apps.
For instance, if you tried to make a typical "here document" type of shell script like this:
#!/usr/bin/sh
ftp <<END_CMDS
open some.ftp.host
myuser
mypassword
cd /some/dir/path
get somefile.dat
bye
END_CMDS
exit 0
You'd find that a typical ftp client will not read the commands from the shell script's /dev/tty and will still try to interactively prompt for user, password, etc. or it might just hang indefinitely waiting for input that will never come to it.
There are other shell scripting tricks to get a "here document" script to function with utilities like ftp/sftp/others, but if you have "expect" installed on your system, it's very simple to run "autoexpect" to record an interactive session of what you want to do, which will then automatically create the "expect script" for you.
"Expect" was created by our (USA) tax dollars, and is free for anyone to use: See the home page here for the whole story: http://expect.nist.gov/ -
How to use encoded password in shell script ?
Hi everybody,
For make a load file in oracle table, I'm using a LKM File to Oracle updatding with a sqlldr (shell script).
My problem is very simple : For security reason in this shell-script , I don't want to see in clear the password of the Oracle user for database connection. Is it possible and how do it ?
Thanks in advanceHi-
Yes it is possible by the way of KM custamization, You need to modify LKM call sqlldr via jython step to pass the user info and password as variable instead of ODI method. Try this command in your KM step:
userid=#GLOBAL.user/#GLOBAL.psw
Hope this will work for you.
Thanks,
Saravanan Rajavel -
I would like to use a 'Like' and wildcards in a shell script. Something like
If $F1 like '*ABC*' then
xxxx
What would the correct syntax for this be?
Thanks!You could do:
if [ ! -z "`echo ${F1} | grep "ABC"`" ] then
fi -
Use Launchd to run shell script at boot
Hello
I'm trying to create a plist file that will run a shell script at bootup of the server.
I have the following xml so far in the plist file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.apple.mymount</string>
<key>ProgramArguments</key>
<array>
<string>/mount-script/./mount.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
The shell script is just a mount command:
#!bin/sh
#MOUNT folder X ON server Y
sudo -u _www mount_smbfs -f 777 -d 777 //username:password@server/folder /mnt/mount
The shell script works fine from the terminal.
I can see the plist has loaded after bootup but the script doesn't run.
What am I doing wrong?
Would need some help please!First problem:
<string>com.apple.mymount</string>
com.apple is (or at least should be) reserved for Apple scripts, not your own. This should be renamed to your own domain (or your own name if you don't have a domain).
In addition the .plist file name should match (so if you rename the script Label to be 'com.my.mount' then the .plist should be com.my.mount.plist. You don't include the file name in your post to know if you're already doing that.
Second:
<string>/mount-script/./mount.sh</string>
What? That looks wrong to me. Of course, it could be right, but the '/./ in the middle worries me, so I just can't think it is.
Where is the script, really?
Third:
sudo -u _www mount_smbfs -f 777 -d 777 //username:password@server/folder /mnt/mount
No. Never use 'sudo' within a launchd task. If you need the task to run as a different user then use the launchd keyword UserName to specify that username:
<key>UserName</key>
<string>_www</string>
I can see the plist has loaded after bootup but the script doesn't run.
If none of the above fixes it then look at the logs and tell us what it has to say. /var/log/system.log -
Loading incomplete using sqlplus_exec_template.sql in shell script
Hi,
I've tried to automate the dataloading by calling sqlplus_exec_template.sql for each mapping in the shell script bash. (I comment out the last exit line in the script). But the loading were always partially complete for those that take longer time, says more than 5 or 10min. I've also tried to call each mapping in different shell and got the same result. How do you work around this? Below is part of the lines in my shell script. Thanks.
sqlplus -s test_rta/test_rta << EOF
@sqlplus_exec_template.sql 'TEST_RTR' 'TEST_LOC' 'PLSQL' 'CONSOL_SUP_MAP' ',' ','
@sqlplus_exec_template.sql 'TEST_RTR' 'TEST_LOC' 'PLSQL' 'CONSOL_PART_MAP' ',' ','
EOFI 've tried to use :
sqlplus username/[email protected] @C:\OWB\owb\rtp\sql\sqlplus_exec_template.sql
rtschema OWBLOCATION SQL_LOADER CRD_APPL_MAPPING "," ","
where OWBLOCATION I have used the deploy location of the mapping for my case, created within OWB. The value is CCS_DEPLOY.
But the error is the same :
======================================================
Stage 1: Decoding Parameters
| location_name=CCS_DEPLOY
| task_type=SQL_LOADER
| task_name=CRD_APPL_MAPPING
Stage 2: Opening Task
declare
ERROR at line 1:
ORA-20001: Task not found - Please check the Task Type, Name and Location are
correct.
ORA-06512: at line 261
========================================================
could you tell me the SQL used by WB_RT_API to get the task from runtime schema. So that I could check the correct location myself.
Or how could I view the pl/sql of WB_RT_API_EXEC which is wrapped.
Thx for your help.
Rg.
CH -
How to use CONCSUB program in shell script program
I have to write a shell script which will further call the concurrent program.
My concurrent program is having 3 parameters. Plz send some suggestion
R's
VijayPl use the search feature to locate threads that have discussed this issue before. Some examples -
Re: modify .out file
Re: shell script using CONCSUB utility
HTH
Srini -
I want this so I can just download anything I want by just having the link and I have made a few things with shell scripts in automator before, just never anything where i need to input a value into the shell script.
Easy:
-
Generate RMAN backup Script using unix shell script
Hello,
Could somebody give me a unix shell script that would generate RMAN script based on some user defined parameters in a config file.
e.g.
rman.conf
CHANNELS=4
USE_CATALOG=Y
DEVICE='sbt_tabe'
etc.,
many thanks,
kamYou can actually encapsulate the RMAN commands inside the shell script.
However if you really want to create a seperate RMAN script file, you can use the unix shell's "echo" command to write set variables to a file.
Thus, for example,
echo "rman target / catalog rman/rmanpassword@crcat" > RMAN_Script.rmn
echo "backup database plus archivelog" >> RMAN_Script.rmn
echo "backup archivelog all" >> RMAN_Script.rmn
creates RMAN_Script.rmn with 3 commands. -
Issue with calling Shell Script using DBMS_SCHEDULER
Hi All,
I am executing a shell script using DBMS_SCHEDULER from APEX web page. Execution part is working fine without any issues.
In my shell script file (abc.sh) I have few oracle sql procedure calls which connects back to same database and that SQL call is not executing some reason, it not giving any errors.
Inside my shell script code looks like this.
sqlplus -silent $USER/$PASSCODE@$SCONNECT > /dev/null <<END
set pagesize 0 feedback off verify off heading off serveroutput on
echo off linesize 1000
WHENEVER SQLERROR EXIT 9
BEGIN
dbms_output.enable(1000000);
do_enable_cons();
dbms_output.disable;
END;
spool off;
exit;
END
When I run this shell script file from backend it works fine now issues.
Is there any restrictions in executing sql code using DBMS_SCHEDULER? Any ones help is much appreciated.
-Regardsjames. wrote:
Thanks you sb and Sybrand . It is problem with environment variables. After running .bash_profile in the beginning of the shell script, it is working fine.
One issue is when I check the process it is showing two entries with two different process id's.
The command I used
ps -ef | grep <my script> is COPY & PASTE broken for you?
any reason why you did not show us EXACTLY was produced by OS command above?
>
Is it something wrong with my code or is it normal? Is it really executing two times ?
-Regards
bcm@bcm-laptop:~$ sqlplus user1/user1
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 20 15:14:15 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
15:14:15 SQL> !ps -ef | grep sqlplus
bcm 24577 1903 1 15:14 pts/0 00:00:00 sqlplus
bcm 24579 24577 0 15:14 pts/0 00:00:00 /bin/bash -c ps -ef | grep sqlplus
bcm 24581 24579 0 15:14 pts/0 00:00:00 grep sqlplus
15:14:23 SQL> how many different copies of "sqlplus" running on my laptop based upon actual output above? -
Random SP2 error when starting oracle process through SHELL script
Hi All,
I am trying to process data in n-Number of tables through a package. The package is called through a shell script to create start data processing. All calls to the package are in a sql script which is basically exec calls-
exec package.process ('T1','some param');
exec package.process ('T1','some param');
exec package.process ('T..n','some param');
I have a shell script which I use to execute commands from the sql script. There is a reason behind using shell script. For some strange reason, I keep on getting -
ERROR: logon denied - check for valid user with valid privileges
SP2-0640: Not connected
SP2-0641: "EXECUTE" requires connection to server
SP2-0640: Not connected
for some EXEC calls. Problem is, errors are generated at random. So in one run, I get error for T10,T11 and then in next run I might get for some other tables.
However, when I am running the sql script from the sql prompt, all calls to the package are executed without any problem.
This makes me think, it is something to do with the way database connection being initiated through UNIX.
Has anyone faced similar issue? Your help/gudence is much appreciated.
DB: Oracle 10.2.0.5
OS: SUN Solaris 10
Thanks in advance.Login credentials are provided inside the shell script.
I did put a sleep(10) after EOF but no help. As mentioned if I run script file from sql promt, it runs without any hiccup. So it is the connection through the UNIX that is causing issue.
As pointed out by Sybrand, I agree that it does not make a sense to connect and commit after every sql statement. So decided to change the shell script and so far, the result from my initial tests on a sample data is quite encouraging. Hopefully I will have a solution.
But it will be nice to know why SHELL is doing what it is doing!!
Legacy prog are sometime big time eye-openers..;) -
Passing variable from sql to shell script
Usually we can pass arguments from shell script to the sql that us called inside the shell script. But I also want to do the reverse. I have the location of my backup path in a table. I want to run the rman script (shell), read this parameter from the table and use this to construct the "format" path in rman. Anyone has any ideas about this. Thanks.
To achieve getting the modified value from the table everytime the job runs, I encapsulated this in another job.
BEGIN
DBMS_SCHEDULER.CREATE_JOB(
JOB_NAME => 'TEST_LOGS_MAIN',
JOB_TYPE => 'PLSQL_BLOCK',
JOB_ACTION => 'declare
v_aname varchar2(32);
begin
select aname into v_aname from attr where attrid = 3;
DBMS_SCHEDULER.CREATE_JOB(
JOB_NAME => ''TEST_LOGS'',
JOB_TYPE => ''EXECUTABLE'',
JOB_ACTION => ''/opt/sql/testy.sh'',
number_of_arguments => 1,
COMMENTS => ''TEST'');
dbms_scheduler.set_job_argument_value(''TEST_LOGS'',1,v_aname);
dbms_scheduler.enable(''TEST_LOGS'');
end;',
REPEAT_INTERVAL => 'FREQ=MINUTELY',
ENABLED => TRUE);
END;
/ -
Passing parameters into a shell script through alias Names ????
I have two alias names ord and dev. And the content of them are as follows.
alias ord
ord='cd ${ORDER}/bin; export APPL_NAME=order; . SetupAppl order'
alias dev
dev='cd ${APPL_ROOT}/bin; export APPL_ENV=dev; . SetupEnv dev'
Alias ord calls a shell script called SetupAppl. Alias dev calls a shell script called SetupEnv.
I am trying to pass a parameter when calling the alias name dev, something like dev WEST. And I
want to read that parameter inside the shell script SetupEnv.
The way I want to execute them, first run the alias ord and then the alias dev. But, when I try
to read the parameter in SetupEnv by $1 it is showing the value of the parameter passed to SetupAppl
ie order and not WEST.
Is there any way to read the value (WEST) passed as a parameter when executing the alias name.
example : dev WEST and reading the value WEST inside SetupEnv
The reason I am executing those scripts (SetupAppl and SetupEnv) with dot(.) in the front is because
those scripts have some export statements which needs to exported to the environment.
Any help on this is highly apprecaitedHi everybody,
I posted same question earlier for UNIX/shell script and rec'd one response. Thanks to Bob.
But the requirement has been changed and now my mgr wants the same task using PL/SQL. Could somebody help me ?
Question again....
I am working on a task which gets report on every remote database.
I created a small database: ‘REPORTS_DB’ and I created 6 'sql' scripts on that database. While executing the first script, it calls the other 5 different 'sql' scripts. All these 5 sql scripts use a '@db_link' (hard coded) and gets that database's report to the database: REPORT_DB.
It is working well. But,
We have 42 databases and I have to get reports of all the 42 databases. Since it is not efficient to create 42 sets of sql scripts, I want to make it automated.
I know (but I don't know HOW) I can pass a parameter (database link name) while running the first script (which calls the other 5 scripts), so that the parameter replaces the @db_link in all the 5 scripts and gets the report of the related (@db_link) database.
Could somebody tell me how to do this task using SQL and PL/SQL ?
OR
send me a sample PL/SQL script to do this task?
Sorry for the inconvenience and thanks in advance.
- JT -
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
Maybe you are looking for
-
Importing from imovie 2.1.2 to imovie 3.0.3
Help! I made a movie in imovie 2.1.2 (with OS 10.2. then my computer was upgraded to OS10.3.9 with imovie 3.0.3 and now I can't import it or open it. Thank you!
-
PO print sent to multiple mail id via email
Hi, We are using the standard output type NEU, medium 5 (external send).i maintained multiple mail id in single vendor master, i want to sent po print out for multiple mail id via email,after wt are all configurations do as a mm and abap consultant,p
-
All, I am trying to make a small change to a custom form in 11i environment. I am getting the below error when I try to open the form in forms builder: "FRM-10102: Cannot attach PL/SQL library QSCUST." However, I am able to open the form and compile
-
Splitting line item in Sales Order-VA02
Hello All, I got struck with the below requirement, Can someone share their ideas, if any one come across such case. Requirement : If ordered material obsolete then system has to propose follow up material ( which will be maintained in MMR-MR
-
Hi Gurus, Please help! What do we need to do to resolve the below security issue? The Functional Guys says: I do not know how an authorization group on the material master works within SAP security. For example, we need to be able to prevent someone