I'm trying to implement dynamic class loading using:
Class.forName(className, true, Thread.currentThread().getContextClassLoader());
Class A (which is a jar file residing in the /jre/lib/ext dir ) that I'm loading extends class B (which is packaged as a separate package with the main...
I've got a .sh script that uses various functions within it. It looks something like this:
x="text.sh $a"
function run
(
a=1
exec $x
)
run
When I run the script, the script complains that $a is empty. Why does the value of '1' not get passed when $x is executed???
I'm using ksh with the following script snippet:
SERVER_PREFIX="Server:"
read role <someFile
name=${role}#$SERVER_PREFIX}
This works fine but when I run it in Bourne shell, I get an error.. 'bad subsitution' for the last line of script.
Does anyone know what the correct syntax is?
Hi,
I've got a Bourne .sh script that has a while do loop. Pseudo code as follows:
x=0
while x<10
do
echo x
x=x+1
done
echo "last value of x is $x"
The last echo statement returns 0. Is there a way to get the value of x from the last invocation of the while loop i.e x=9???
How do I read an xml file that has been compressed with Unix gzip? I tried using GZIPInputStream but I get errors relating to "unsupported five or six byte UTF-8 sequence".
I need to schedule a couple of tasks at different intervals. Would I need to create 2 separate TimerTask tasks to achieve this, each with its own run() method?
Many thx.
How do I go about writing a program to time the creation of a process and a thread? I need to be able to illustrate that the time to create a thread is less than that for a process - or vice versa.
I'm trying to do something like this:
1. Get today's date: lets say Jan 1, 2003
2. todayDate.add(Calendar.Date, -1);
3. The return output is:
yy - 2003
mth - Jan
dd - 31
I'm expecting the new date to be Dec 31, 2002. What went wrong?
Using ksh, how would I do the following within a script:
1. Check for existence of a file
2. If file exists, do some other tasks. At the same time as these tasks are being done, continually rpt step 1. As soon as step 1 detects that file does not exist, quit from script immediately. If and when...
How I do the following in Solaris:
1. Check to see of environ. variable $TAPE is set.
2. If it is not, then set it to /dev/rmt/0n
3. If it is set, then dont do anything.
Is it possible to use 'tar' to only create an archive with directories - no files belonging to these dirs.? I basically only want to save the dir. structure without the files.
I need to be able to backup JUST the file system's directory structure (not files e.g only /usr /opt) via cpio and also to save a copy to a flat file. How do I deal with soft links? This is important since when I do the restore via cpio, I want to be able to recreate the directories and also...
I have a Unix script which invokes many other scripts in parallel in the background. Is there a way to find out the exit status for each of these other scripts? May be thru its PID?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.