Hi..everyone..plz share realtime unix shellscript commands
hi..everyone..plz share realtime unix shellscript commands that are used in oracle pl/sql development my mailid: [email protected]
rajsekharb wrote:
hi..everyone..plz share realtime unix shellscript commands that are used in oracle pl/sql development my mailid: ????????????
You are unwise to publish your email address on public forums, as spambots will pick it up and you will be inundated with spam.
Also, consider that the Oracle forums are a community where people support each other on the forums, they are NOT a personal support desk for you, so it is considered quite rude to ask people to email you answers to your question as if you are not wanting to spend your time on the forums discussing your requirements.
As Billy says, your question doesn't make much sense. You've used the word "realtime" completely out of context. Perhaps you were referring to scripts that people use for real in their businesses to help support pl/sql development? but still it's not clear what sort of scripts you are looking for, and considering this forum is for SQL and PL/SQL programming assistance, your requesting Unix scripts is not really appropriate unless you explain yourself and how your requirement relates to SQL and/or PL/SQL.
Similar Messages
-
Trouble Creating Share Point via 'sharing' Command
I'm having trouble creating a share point via the command line using the 'sharing' utility. Basically just trying to script the creation of a /WindowsShares/ share via SMB.
Here is the command:
<pre class=command>sharing -a /WindowsShares/ -n WindowsShares -s 001 -g 000 -i 00 -o 0 -t 1'</pre>
It seems like everything works. <pre class=command>sharing -l</pre> shows this:
<pre class=command>name: WindowsShares
path: /WindowsShares/
afp: {
name: WindowsShares
shared: 0
guest access: 0
inherit perms: 0
ftp: {
name: WindowsShares
shared: 0
guest access: 0
smb: {
name: WindowsShares
shared: 1
guest access: 0
inherit perms: 0
oplocks: 0
strict locking: 1
directory mask: 493
create mask: 420
}</pre>
However, it doesn't seem to write anything to the /etc/smb.conf file... So nothing works.
If I enter the following in smb.conf the share does work:
<pre class=command>[WindowsShares]
oplocks = 0
map archive = no
vfs objects = darwin_acls
path = /WindowsShares
read only = no
strict locking = 1
inherit permissions = 0
comment = macosx
create mask = 0644
guest ok = 0
directory mask = 0755</pre>
However, even after entering this information - when I check 'Share Points' within WGM the share IS listed - but the 'Share this item and its contents' is NOT checked and thus, is confusing and can't be modified from WGM.
Am I missing something when I am creating this share via the CLI?
I assumed using 'sharing' worked the same way as using WGM and checking 'Share this item and its contents' - that works perfectly.
I tried this with 10.4.8 and 10.4.9 Server (Universal).
Any help would be appreciated!Hi Gary,
Thanks for the reply...
I ran the 'serveradmin' command to discover the SMB settings before and after the change via WGM. I restarted the SMB service as well...
<pre class=command>S999EDC1:~ root# serveradmin settings smb:\*
smb:encrypt passwords = yes
smb:log level = 2
smb:display charset = "UTF-8-MAC"
smb:security = "ads"
smb:deadtime = 5
smb:hide dot files = "yes"
smb:guest account = "unknown"
smb:client ntlmv2 auth = "yes"
smb:preferred master = no
smb:defer sharing violations = "no"
smb:adminCommands:homes = yes
smb:adminCommands:serverRole = "domainmember"
smb:adminCommands:ldapRole = "1.1 - hosting a master LDAP directory server\n"
smb:allow trusted domains = yes
smb:netbios name = "S999EDC1"
smb:lanman auth = "YES"
smb:vfs objects = "darwin_acls"
smb:wins support = no
smb:brlm = "yes"
smb:max smbd processes = 0
smb:server string = "S999EDC1 OS X Server"
smb:os level = 8
smb:domain logons = no
smb:passdb backend = "opendirectorysam guest"
smb:dos charset = "CP437"
smb:realm = "EDU.CBE.AB.CA"
smb:unix charset = "UTF-8-MAC"
smb:auth methods = "guest opendirectory"
smb:local master = no
smb:domain master = no
smb:map to guest = "Never"
smb:use spnego = yes
smb:printer admin = "@admin, @staff"
smb:ntlm auth = "YES"
smb:workgroup = "CBEEDU"</pre>
The only difference was that smb:workgroup = "CBEEDU" and smb:log level = 2 were reversed. The settings were the same though. Thought that was odd.
When making the change via 'sharing', there is no change.
Is there any other documentation on 'sharing' other than the man page and CLI Guide from Apple? I haven't been able to find anything concrete. -
How to call unix script/command in ODI
Hello Gurus,
Please let me know how to call unix script/command in ODI?
Thanks
Shridharyou can call shell script using the OS command found in Package.
Step 1. Drag the OS Command in the Packgae
Step 2. In the Text mentiond call the script say for ex sh /opt/path/script.sh
Step 3. Execute.
Note : Make sure the User through which ODI is triggering does have the required permission to execute shellscript , also always provide the full path , since scripts are execute from the oracldi/bin folder so its necessary to provide the complete path of the script location.
Hope this helps. -
UNIX sed commands to clean up data before loading into BI
Hi all,
we are trying to load the data into BI from text files.. This data needs to be cleaned before it can be loaded into BI and this has to be done using UNIX sed commands!!
We basically need to do a data cleansing act, like removing unwanted characters (tab values and newline values as part of the characteristic values). How can it be done using unix sed commands??
your help is very much appreciated.
RegardsHi all,
we are trying to load the data into BI from text files.. This data needs to be cleaned before it can be loaded into BI and this has to be done using UNIX sed commands!!
We basically need to do a data cleansing act, like removing unwanted characters (tab values and newline values as part of the characteristic values). How can it be done using unix sed commands??
your help is very much appreciated.
Regards -
Problem with unix "foreach" command
Hi,
I am facing a problem with unix command "foreach". I trying to process files using unix foreach command. When running the script with 500 or 1000 files. It is running fine. But when I am trying to the script with 2000+ files. Its throwing an error "Arguments too long".
below is the syntax I am using in the script:
foreach name (*)
end
Could anybody help me on this issue.
Thanks in Advance.
Manasa.UNIX/Linux systems expand wildcards onto the command line before invoking the
individual commands. In effect, the shell rewrites the command line you give
substituting the wildcard expansion. There is a limit to how long this command
line can get.
For example, suppose you have two files ("foo" and "bar") in your directory.
The line:
foreach name (*)
echo $name
endgets rewritten to:
foreach name (foo bar)
echo $name
endand then the shell starts interpreting your script. So if you have many, many
files, the rewritten line becomes:
foreach name (f1 f2 f3 ... f10927)
echo $name
endso chances are the "foreach" line simply gets too long. To avoid problems do
it this way; it avoids any problems based on how many files you have:
ls | while read name
do
echo $name
doneThis way the shell never exceeds its line length limitations because the
wildcard is never expanded.
Cheers -
Invoking a UNIX shell command from Java stored procedure
The program below is suppose do send an email using UNIX mailx program. It works correctly when I compile it in UNIX and invoke it from the command line by sending an email to the given address.
I need this program to run as a stored procedure, however. I deploy it as such and try to invoke it. It prints the results correctly to the standard output. It does not send any emails, however. One other difference in execution is that when invoked from the command line, the program takes about a minute to return. When invoked as a stored procedure in PL/SQL program or SQL*Plus anonymous block, it returns immediately.
Why would mailx invocation not work from a stored procedure? Are there other ways to invoke mailx from PL/SQL?
Thank you.
Michael
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
public class MailUtility
public static void main(String[] args)
System.out.println(mailx("Hey, there", "Hello", "oracle@solaris10ora", 1));
* Sends a message using UNIX mailx command.
* @param message message contents
* @param subject message subject
* @param addressee message addressee
* @param display if greater than 0, display the command
* @return OS process return code
public static int mailx(String message, String subject,
String addressee, int display)
System.out.println("In mailx()");
try
String command =
"echo \"" + message + "\" | mailx -r [email protected]" + " -s \"" + subject + "\" " + addressee;
if (display > 0)
System.out.println(command);
try
Process process = Runtime.getRuntime().exec("/bin/bash");
BufferedWriter outCommand =
new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));
outCommand.write(command, 0, command.length());
outCommand.newLine();
outCommand.write("exit", 0, 4);
outCommand.newLine();
outCommand.flush();
process.waitFor();
outCommand.close();
return process.exitValue();
catch (IOException e)
e.printStackTrace();
return -1;
catch (Exception e)
e.printStackTrace();
return -1;try adding the full explicit path to "mailx" in the command string that gets sent to Runtime. i would guess that the shell that gets spawned might not have a proper environment and thus mailx might not be found.
== sfisque -
Starting Unix shell command with 7.3.4
Hallo,
does anybody have a easy to use solution to start an
Unix shell command with Oracle 7.3.4 ????
Thanxfound on metalink :
Certify - Certification Matrix: Oracle Server - Enterprise Edition on HP Tru64 UNIX
Server Certifications
OS Product Certified With Version Status Addtl. Info. Components Other
5.1b 8.1.7 (8i) 64-bit N/A N/A Certified Yes None None
5.1a 8.1.7 (8i) 64-bit N/A N/A Certified Yes None None
5.1 8.1.7 (8i) 64-bit N/A N/A Certified Yes None None
5.0a 8.1.7 (8i) 64-bit N/A N/A Certified Yes None None
5.0 8.1.7 (8i) 64-bit N/A N/A Desup:OS Yes None N/A
4.0f-g 8.1.7 (8i) 64-bit N/A N/A Certified Yes None None
4.0d-e 8.1.7 (8i) 64-bit N/A N/A Desup:OS Yes None N/A --------------------------------------------------------------------------------
Copyright (c) 1995,2000 Oracle Corporation. All Rights Reserved. Legal Notices and Terms of Use. -
Unix find command...
My problem exists with the behavior on the unix find command, or my lack of understanding of it.
For example, I work for a graphics company and we have a constant folder structure like this:
*12345 Apple - Poster*
~....~01_Layouts
~....~02_Images
~....~03_Fonts
~....~04ClientOriginals
~........~01.28.08_14:46
~........~03.07.08_15.03
~........~03.10.08_17.22
When we receive files from a customer, the CSR creates a folder inside 04ClientOriginals following a format like 03.06.08_10.15, and copies the files/folders from customer supplied media into them.
I have set up a launchd script that finds all of the date/time stamped folders inside of 04ClientOriginals that have not been modified within the past month and stuff them with the Stuffit command line utility. I do that with this command:
find . -type d –mtime +30 -ipath #/04ClientOriginals/# -exec /usr/local/bin/stuff -f sit5 -m 2 -o -D {} \;
This command works fine except in those cases where there are folders over 30 days old inside of a parent directory that is not 30 days old yet. I only want the find to descend to one level below 04ClientOriginals, and no further.
I thought by adding an extra "/" at the end of the path #/04ClientOriginals/#/ instead of #/04ClientOriginals/# would keep it from descending further down, but when I try this the search returns no results. Also, I can’t use -maxdepth in my find arguments because the depth of 04ClientOriginals is not always constant.
Any help would be greatly appreciated.
Thanks.
Edit: Due to the lack of decent markup tools for formatting code on the Apple Discussion Board, the wildcards in my file paths have been substituted with a "#". Kind of ridiculous for a unix discussion board to not have code highlighting capability.
Message was edited by: Guriboyetresoft wrote:
I don't know if these will work or not. Regular expressions are powerful, but tricky. Plus, there are a few different, but similar, varieties. Also, I don't know if the find within a find syntax will work. This might be something that is better suited to Perl. You would then have much more control over what you are doing.
Running this find command finds exactly what I'm looking for:
find . -type d -name "04ClientOriginals" -exec find {} -mtime +30 -type d -maxdepth 1 ;
I hope I'm wrong, but can't you call -exec only once? As a test I ran this:
find . -type d -name "04ClientOriginals" -exec find {} -mtime +30 -type d -maxdepth 1 -exec ls -l {} ;
If I invoke -exec a second time, I get this error:
find: -exec: no terminating ";" or "+"
find: -exec: no terminating ";" or "+"
find: -exec: no terminating ";" or "+"
I've searched high and low and I cannot find an example of the find command calling -exec more than once.
My regex skills are pretty weak, so I'll only tread those waters if I have to. -
Unix Shell Command Monitor broken
Hi all,
Few days ago I've noticed that I am not able to create/modify Unix Shell Command monitors (two/three states)
Screenshot: http://fotki.yandex.ru/users/neverregret/view/609083
I am domain admin and Operations Manager admin so I have sufficient privileges automatically.
Could you please advice what is going wrong?
I'll appreciate any help.
Thank youHas the SCOM server been upgraded or patched prior to this starting or were any MPs removed that are associated to the UNIX/Linux functionality?
Check and see if the Microsoft.SystemCenter.CrossPlatform.UI.OM.Integration.Authoring.ShellCommandTemplate.dll file exists under the SCOM directory structure.
You can download the latest UNIX/Linux MPs/agents from here
http://www.microsoft.com/en-us/download/details.aspx?id=29696 and try updating the Microsoft.Unix.ShellCommand.Library.mpb MPs and see if that helps.
Regards,
-Steve -
Pls Send Usefull UNIX /LiNUX commands in SAP?
hi,
pls send me anybody what are the useful UNIX/LINUX commands in SAP.
regards,
reddyHi brother,
the following commands will help you do it and practice it give rewards....
Copy files one system to another system in network
#mount -t nfs <IPAddress> : /<Source Directory> /<Target Directory>
To Display Clock
#xclock
Check Process Details:
#top
#ps -ef | grep user/process/servicename
Check Memory Size:
#free
Check Disk space:
#df -k (in %)
#df -h (in GB)
Check Subdirectory files
#du /usr -
Accessing tape device from Terminal program using UNIX tar command
I am trying to create some tape backups of very large files (.dmg images) using the UNIX tar command.
I have a 72GB HP 4mm DAT USB drive, which shows up in the system profiler as:
DAT72 USB Tape:
Version: 30.30
Bus Power (mA): 500
Speed: Up to 480 Mb/sec
Manufacturer: Hewlett Packard
Product ID: 0x0125
Serial Number: 4855310528334645
Vendor ID: 0x03f0
But I do not see the device in the /dev/ directory (see below).
Is there a way I can determine the UNIX device name?
Or must I locate and load a driver for this DAT drive?
Thank you
Jeff Cameron
Last login: Mon Jun 9 20:14:36 on ttys000
caladan:~ jeff$ ls /dev/
appleAE0 ptyq7 ptyuc ttyp0 ttyt4
autofs ptyq8 ptyud ttyp1 ttyt5
autofs_control ptyq9 ptyue ttyp2 ttyt6
autofs_nowait ptyqa ptyuf ttyp3 ttyt7
bpf0 ptyqb ptyv0 ttyp4 ttyt8
bpf1 ptyqc ptyv1 ttyp5 ttyt9
bpf2 ptyqd ptyv2 ttyp6 ttyta
bpf3 ptyqe ptyv3 ttyp7 ttytb
console ptyqf ptyv4 ttyp8 ttytc
cu.Bluetooth-Modem ptyr0 ptyv5 ttyp9 ttytd
cu.Bluetooth-PDA-Sync ptyr1 ptyv6 ttypa ttyte
cu.Palm ptyr2 ptyv7 ttypb ttytf
cu.modem ptyr3 ptyv8 ttypc ttyu0
disk0 ptyr4 ptyv9 ttypd ttyu1
disk0s1 ptyr5 ptyva ttype ttyu2
disk0s3 ptyr6 ptyvb ttypf ttyu3
disk1 ptyr7 ptyvc ttyq0 ttyu4
disk1s1 ptyr8 ptyvd ttyq1 ttyu5
disk1s3 ptyr9 ptyve ttyq2 ttyu6
disk1s5 ptyra ptyvf ttyq3 ttyu7
disk2 ptyrb ptyw0 ttyq4 ttyu8
disk2s1 ptyrc ptyw1 ttyq5 ttyu9
disk2s10 ptyrd ptyw2 ttyq6 ttyua
disk2s11 ptyre ptyw3 ttyq7 ttyub
disk2s2 ptyrf ptyw4 ttyq8 ttyuc
disk2s3 ptys0 ptyw5 ttyq9 ttyud
disk2s4 ptys1 ptyw6 ttyqa ttyue
disk2s5 ptys2 ptyw7 ttyqb ttyuf
disk2s6 ptys3 ptyw8 ttyqc ttyv0
disk2s7 ptys4 ptyw9 ttyqd ttyv1
disk2s8 ptys5 ptywa ttyqe ttyv2
disk3 ptys6 ptywb ttyqf ttyv3
disk3s1 ptys7 ptywc ttyr0 ttyv4
disk3s3 ptys8 ptywd ttyr1 ttyv5
disk3s5 ptys9 ptywe ttyr2 ttyv6
dtrace ptysa ptywf ttyr3 ttyv7
dtracehelper ptysb random ttyr4 ttyv8
fbt ptysc rdisk0 ttyr5 ttyv9
fd ptysd rdisk0s1 ttyr6 ttyva
fsevents ptyse rdisk0s3 ttyr7 ttyvb
klog ptysf rdisk1 ttyr8 ttyvc
lockstat ptyt0 rdisk1s1 ttyr9 ttyvd
machtrace ptyt1 rdisk1s3 ttyra ttyve
null ptyt2 rdisk1s5 ttyrb ttyvf
profile ptyt3 rdisk2 ttyrc ttyw0
ptmx ptyt4 rdisk2s1 ttyrd ttyw1
ptyp0 ptyt5 rdisk2s10 ttyre ttyw2
ptyp1 ptyt6 rdisk2s11 ttyrf ttyw3
ptyp2 ptyt7 rdisk2s2 ttys0 ttyw4
ptyp3 ptyt8 rdisk2s3 ttys000 ttyw5
ptyp4 ptyt9 rdisk2s4 ttys1 ttyw6
ptyp5 ptyta rdisk2s5 ttys2 ttyw7
ptyp6 ptytb rdisk2s6 ttys3 ttyw8
ptyp7 ptytc rdisk2s7 ttys4 ttyw9
ptyp8 ptytd rdisk2s8 ttys5 ttywa
ptyp9 ptyte rdisk3 ttys6 ttywb
ptypa ptytf rdisk3s1 ttys7 ttywc
ptypb ptyu0 rdisk3s3 ttys8 ttywd
ptypc ptyu1 rdisk3s5 ttys9 ttywe
ptypd ptyu2 sdt ttysa ttywf
ptype ptyu3 stderr ttysb urandom
ptypf ptyu4 stdin ttysc vn0
ptyq0 ptyu5 stdout ttysd vn1
ptyq1 ptyu6 systrace ttyse vn2
ptyq2 ptyu7 tty ttysf vn3
ptyq3 ptyu8 tty.Bluetooth-Modem ttyt0 zero
ptyq4 ptyu9 tty.Bluetooth-PDA-Sync ttyt1
ptyq5 ptyua tty.Palm ttyt2
ptyq6 ptyub tty.modem ttyt3
caladan:~ jeff$ logoutI downloaded the BRU LE 30 day evaluation, and my first impression is favorable. I still need to perform a bit of testing. The HP drive I have does 36 GB per tape (72 at 50% hardware compression). My first attempt was to back up a single 22 GB .dmg file. Even with no compression it should have fit on one DAT tape, but after backing up 90% of the 22 GB it asked for a second tape. I still have to do more testing, but I very much appreciate the point in the very promising direction.
I will reply again to this thread with my results.
Jeff Cameron -
Using robocopy to copy files from a network share over a WinRS command line session
Hello,
Preface: Using server 2008 enterprise.
I can't seem to get robocopy to function over WinRS and I'm not sure where the problem actually lies. Running robocopy locally on the computer does work fine, but as soon as I try to run it through a remote command prompt through the WinRS client or directly with the WinRS client I get an access denied message (error 5).
I've tried using runas while logged into the remote command prompt as well, thinking that it could have been some sort of permissions inheritence issue.
I've checked the permissions on the remote file share, I've even given 'Everyone', 'Anonymous Logon' and the computer's active directory account full control over the folder and the file I'm trying to copy, but still get the access denied error.
I've tried using /COPY:DT since I read that usually resolved error 5 issues.
None of these things have worked.
I'm kind of out of ideas, I've read some blogs of people who have written powershell scripts which use winrm/robocopy so I figure I'm missing something stupid. Or maybe I've stumbled upon a bug?
C:\>robocopy \\192.168.100.1\share c:\test example.exe
ROBOCOPY :: Robust File Copy for Windows
Started : Mon Feb 09 17:35:32 2009
2009/02/09 17:35:32 ERROR 5 (0x00000005) Getting File System Type of Source \\192.168.100.1\share\
Access is denied.
Source - \\192.168.100.1\share\
Dest : c:\test\
Files : example.exe
Options : /COPY:DAT /R:1000000 /W:30
2009/02/09 17:35:32 ERROR 5 (0x00000005) Accessing Source Directory \\192.168.100.1\share\
Access is denied.Yep, I verified permissions on them all :(
To maybe complicate the issue, I looked at the environment variables for myself while logged in locally to the computer and through WinRS and they look to be the same.
EDIT: Out of pure frustration I wrote a quick console application which impersonates the currently logged in user and copies a file from the network share I'm trying to access to the local computer. The application properly impersonates the user - but does not copy the files while it's run through WinRM. When you run the application as a locally logged in user it works just fine.
WinRM must be behaving goofy :(
This is the output of the following application:
C:\Windows\System32>test.exe
Name: domain\loggedinuser
IsAuthenticated: True
User: {GUID}
AuthenticationType: Kerberos
Destination directory doesn't exist, creating new directory..
Undoing impersonation..
No exceptions, no nothing :(
Imports System.IO
Imports System.IO.File
Module Module1
Dim impersonationContext As System.Security.Principal.WindowsImpersonationContext
Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
Dim cpr As New copyProgress(AddressOf FileCopyProgress)
Dim destinationDir As DirectoryInfo = New DirectoryInfo("c:\destination\")
Private Delegate Function copyProgress(ByVal totalFileSize As Int64, ByVal totalBytesTransferred As Int64, ByVal streamSize As Int64, ByVal streamBytesTransferred As Int64, ByVal dwStreamNumber As Int32, ByVal dwCallbackReason As Int32, ByVal hSourceFile As Int32, ByVal hDestinationFile As Int32, ByVal lpData As Int32) As Int32
Private Declare Auto Function CopyFile Lib "kernel32.dll" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal lpProgressRoutine As copyProgress, ByVal lpData As Int32, ByVal lpBool As Int32, ByVal dwCopyFlags As Int32) As Int32
Private Function FileCopyProgress(ByVal totalFileSize As Int64, ByVal totalBytesTransferred As Int64, ByVal streamSize As Int64, ByVal streamBytesTransferred As Int64, ByVal dwStreamNumber As Int32, ByVal dwCallbackReason As Int32, ByVal hSourceFile As Int32, ByVal hDestinationFile As Int32, ByVal lpData As Int32) As Int32
End Function
Private Function FileCopyProgress2(ByVal totalFileSize As Int64, ByVal totalBytesTransferred As Int64, ByVal streamSize As Int64, ByVal streamBytesTransferred As Int64, ByVal dwStreamNumber As Int32, ByVal dwCallbackReason As Int32, ByVal hSourceFile As Int32, ByVal hDestinationFile As Int32, ByVal lpData As Int32) As Int32
End Function
Sub Main()
Try
currentWindowsIdentity = CType(System.Security.Principal.WindowsIdentity.GetCurrent, System.Security.Principal.WindowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()
Console.WriteLine("Name: " & currentWindowsIdentity.Name)
Console.WriteLine("IsAuthenticated: " & currentWindowsIdentity.IsAuthenticated)
Console.WriteLine("User: " & currentWindowsIdentity.User.ToString)
Console.WriteLine("AuthenticationType: " & currentWindowsIdentity.AuthenticationType)
If Not destinationDir.Exists Then
Console.WriteLine("Destination directory doesn't exist, creating new directory..")
destinationDir.Create()
End If
CopyFile(Path.Combine("\\192.168.100.1\share\", "example.exe"), Path.Combine("c:\destination\", "example.exe"), cpr, 0, 0, 0)
Catch ex As Exception
Console.WriteLine(ex.ToString)
Finally
Console.WriteLine("Undoing impersonation..")
impersonationContext.Undo()
End Try
Console.ReadKey()
End Sub
End Module -
How to execute a unix/dos command in Java
Hi,
I want to execute dos/unix commands in my java program. Can anyone tell me how to do this. Say I want to restart my httpd daemon using the command: "service httpd restart" or test my httpd.conf file using the command "testparn"
thanks in advance
Hugo Hendrikshallo,
test this:
Process p = Runtime.getRuntime().exec(Your_Programm);
p.waitFor();
LineNumberReader lnr = new LineNumberReader(new InputStreamReader(p.getInputStream()));
Your_Programm must be a shellscript. regard that your java programm must have the right to start the httpd!
Carsten Bluetner -
Hello,
I'm trying to execute the CRYPT command from SM69.
From cmd line the following works
crypt TEST <FILE1.txt >FILE2.txt
Anyone get this to work?@tschodt
Well, you failed to mention that...I spend at least 5hours about writing an efficient Java code for big text file.
Within this time I read 50 to 100 forum threads from other people who had the same problem.
All these pages I had found via google. Do you want me to write everything, all actions I did? :-) I don't think so.
Is everyone else happy to use Runtime.exec() to invoke "sed"? How should I know that? :-) I am not a java expert.
The idea of forums generally is, to share knowledge with other people.
Well, after you said that, I will use Runtime.exec() and invoke sed and read the results.
If you think you really need a full Java implementation of sed and
you have not been able to locate one, you could always write one yourself...I don't need a full Java implementation of sed, not really.
But just because I didn't find it, does not mean for me, that this code is no where exists.
First I try to write the code by myself, second, I try to find it on internet by searching in google.
If I still have no solution, I write my problem here at sun-java-forum (sometimes also somewhere else :-) )
It seems to me you are angry, no need to be ... -
Error while Executing Unix Shell Commands Using Runtime clas
I am trying to run the following code in java on unix machine to execute cat command.
Runtime runtime = Runtime.getRuntime();
try {
System.out.println("before catexecute");
Process process = runtime.exec("cat /export/home/shankerr/local.profile > /export/home/shankerr/local1.txt");
try {
if (process.waitFor() != 0) {
System.err.println("exit value = " +
process.exitValue());
catch (InterruptedException e) {
System.err.println(e);
But i get the following error on the console
exit value = 2
cat: cannot open >
cat: cannot open /export/home/shankerr/local1.txt
The same command if i run on unix console directly it creates a new file and copies the content into the new file local1.txt
kindly help me on the sameThe redirection operator > along with stuff like pipe | history !$ etc. is interpreted by the shell, not by the cat program.
When you do cat X > Ycat only sees the X. The rest is interpreted by the shell to redirect the cat program's stdout.
However, when you Runtime.exec(), you don't have the shell, so cat sees X > Y as its arguments, and interprets them all as file names. Since there's no file named > you get the error.
The solution is to first man cat on your system and see if it happens to have a -o or somesuch operator that lets it (rather than the shell) send its output to a file. If not, then you need to invoke a shell, and pass it cat and all of cat's args as the command to execute.
Read the man pages for you shell of choice, but for bash, I believe you'd give Runtime.exec() something like /bin/bash -c 'cat X > Y'
Maybe you are looking for
-
Bootcamp Trackpad Settings Reset on Reboot
I have a 15in MacBook Pro running Vista and every time I start the computer I have to go back into the Bootcamp trackpad settings and turn on "tap to click" and "2 finger tap to right click". It never seems to remember these settings. Does anybody ha
-
Infrastructure team is migrating domain\SQLSERVER db to new 'XYZ' Location. Also they are moving these DBs to virtual server. Currently these are physical DB servers. I am trying to keep the server names as same 'SQLSERVER ', but IP address may chan
-
Facts and Dimension tables.
We have around 6 facts tables and 10 dimensions tables. The ER diagram shows the fact tables are joined. Now how do I arrange these tables in order to form a star schema? Any suggestions?
-
One of our sap server has gone due to hardware failures where SQL server is used as the backend. I have the full database backup and I want to restore the server from that backup. Can someone pls point me to good references/guides for doing the same?
-
InfoPath 2013 start a workflow
In a new InfoPath 2013 form that uses a custom list, I would like to add a custom button and/or something to click on for the user to eventually 'start a workflow when item changes'. Right now since I am in the early phase of the process, and it woul