scripting

How to create and restore backups of the Oracle 10g database by using commanline scripts automatically?

I want to automate the periodic backup and restore of the Oracle 10g Database.Please, someone help me immediately. and please note that I want the task to be performed from the command line scripts. ...

Get parent directory name for a particular file using DOS Batch scripting

Hello, I need to find the name of the parent directory for a file in DOS for ex. Suppose this is the directory C:\test\pack\a.txt I have a script which asks me the file name C:\\>getname.bat enter file name: c:\test\pack\a.txt now the script should return just the parent name of the file. pack and NOT the ...

Calculate difference of numbers in two files

Say I have two files where there is one number per line File 1 file 2 0.12 0.11 0.121 0.454 .... .... I want to create file or output difference between each number on to the screen, so that result looks like 0.0099 -0.333 ...... You can use bash/awk/sed ...

Does COM automatically unload DLLs when there are no more object references?

For example, in language X: let x = CreateOject( "MyProgID" ) x.LateBoundCall() x.Release() // (or setting x to Nothing in VB-like language, etc) What happens to the DLL MyProgID lives in? Does COM unload DLLs automatically? EDIT This is assuming that the code above is in an executable that does not expose any COM. ...

Redirect output of shell script to a file

I'm trying to redirect the output of my script and it needs to be called inside the script. filename=uname -a filename="$filename" date 2>&1 | tee $filename".txt" That is what I have so far, but it's obviously wrong. I don't know too much SH scripting, so help is appreciated -Alex ...

Vim Register Use in Ex Mode

Potentially 2 questions in one. I would like to know how to reference a register in Ex mode. For instance, I'm editing a file and I want to save the file with a timestamp (or just datestamp really) appended to it. I know I can set register to the value of a shell commands output using: :let @a = system("date +\"%Y-%m-%d\"") Is ther...

cd option in bash script

I'm a complete newbie to bash scripting. I remember there was a way to execute the cd command, automatically returning to the current directory (without an explicit cd ..). Any idea? ...

Running the shell scripts in Background

Hello, I would to give the user the feature to run the shell script in background. My shell program instantiates a number of other shell scripts. Here is a small code snippet of my script ./main.sh # Main script in main.sh I call preprocessing.sh create_dir.sh handle_file.sh post_processing.sh report_generation.sh I would like t...

PHP multiuser login class or script

I am looking for a simple but secure login script with mySQL PHP: sessions, MD5 that I can use with my exsisting database. Cookies to store password + password recovery by email. Change login/pass. I do not need registering, I register the user myself with temp login/pass. table agents agent1 agent2 table albums album1, owner: age...

How can I execute a bunch of editor commands stored in a file in VIM?

I have read the other posts, e.g., http://stackoverflow.com/questions/1830886/vim-executing-a-list-of-editor-commands and others. The answer isn't clear to me for my case. I have some editor commands that I generated from an SQL query. It uses :s/foo/bar to change country codes (from FIPS to a non-standard code set). Here's a sample of t...

Getting information from scripts/command line calls in C#

I've been writing a couple of apps which use C# as the Gui, but under the hood do all the work via scripts (which may be Python, Ruby etc.). To pass information from the script back to the GUI (for example error reporting etc.) I've usually resorted to calling the script via Process and either Redirected the input (StartInfo.Redirec...

Folder Comparsion

Hi, I have two folders with sub folders. One folder is base folder other one is local folder These folders & subfolders consist identical as well as non identical files. I want compare these folders and report the result in some other file This report must consist of 1. List of All identical files 2. List of All modified files 3. List ...

Get other than error level from exe

Hi. Is it possible to get a return value other than error level from .net exe? The exe is to be called from a script, batch or rexx. If not, can you invoke a method in an assembly from batch or rexx and retrieve a return value? ...

What's the best way to add scripting to an Android app?

I have an XML based file format that I'm using to store and load instances of objects. I'm interested in adding some scripting support to those objects so that they can respond to events. That said, I also don't want to cripple performance. Are there any well known scripting options for Android - maybe even ones where while loading, I...

How to get the incoming ssh/telnets clients local IP address from a shell script or C

I need a way to obtain a local (not WAN) address of an incoming telnet or ssh session using a shell script or C. ...

How to make an application scriptable in Linux

I've written an application in C++ that takes a complex binary file format and translates it into human-readable text. Having edited the text you can recompile it back into the binary file format. This would be more useful if the application's internal object model was scriptable. On Windows I'd expose the objects using COM or .Net bu...

Vim - ex mode command - is there any way to move the cursor position?

In a one line Vim ex command: I am trying to do a command and then move to another location and execute the same command. is there any way to move the cursor position (need both left/right and up/down)? ...

Logon script for a mixed operating system environment

Hi Friends, I have a Active Directory controller on a Windows 2003 server. My users use Windows, Linux, Mac OS, Novell Operating system on client machines. I need to create a login script which is interoperable on all the client operating systems. Any ideas would be greatly appreciated on how to accomplish this. I was searching for a ...

Best way to convert log files (*.txt) to web-friendly files (*.html, *.jsp, etc)?

I have a bunch of log files which are pure text. Here is an example of one... Overall Failures Log SW Failures - 03.09.2010 - /logs/swfailures.txt - 23 errors - 24 warnings HW Failures - 03.09.2010 - /logs/hwfailures.txt - 42 errors - 25 warnings SW Failures - 03.10.2010 - /logs/swfailures.txt - 32 errors - 27 warnings HW Failures - 03....

Issues running python scripts in Command Prompt (Specifically with command line arguments)?

I am trying to run my python scripts in the command-prompt without calling python.exe first. I am specifically doing this in relation to running django-admin.py. I have C:\Python26 and C:\Python26\Scripts in my PATH. However, if I try running django-admin.py by doing: django-admin.py startproject helloworld I get the message: T...