The "disown" command works in bash, but not in ksh.
If I have started a process in ksh, how can I "disown" it, so I can exit my shell.
(I know about nohup, but the process has already started!)
I have a text file containing unwanted null characters. When I try to view it in I see ^@ symbols, interleaved in normal text. How can I:
a) Identify which lines in the file contains null characters? I have tried grepping for \0 and \x0, but this did not work.
b) Remove the null characters? Running strings on the file cleaned it up, but I'm just…
How can I get the current local wall clock time (in number of millis since 1 Jan 1970) in London? Since my application can run on a server in any location, I think I need to use a TimeZone of "Europe/London". I also need to take Daylight Savings into account i.e. the application should add an hour during the "summer".
I would prefer to use the…
Given a word W, I want to find all words containing the letters in W from /usr/dict/words.
For example, "bat" should return "bat" and "tab" (but not "table").
Here is one solution which involves sorting the input word and matching:
word=$1
sortedWord=`echo $word | grep -o . | sort | tr -d '\n'`
while read line
do
sortedLine=`echo $line |…
I have a text file containing unwanted null characters. When I try to view it in I see ^@ symbols, interleaved in normal text. How can I:
a) Identify which lines in the file contains null characters? I have tried grepping for \0 and \x0, but this did not work.
b) Remove the null characters? Running strings on the file cleaned it up, but I'm…
Hi
Can someone explain how the G1 Garbage Collector works please? I haven't been able to find any comprehensive, easy-to-understand descriptions anywhere yet.
Thanks
I am reading a text file which contains numbers in the range [1, 10^100]. I am then performing a sequence of arithmetic operations on each number. I would like to use a BigInteger only if the number is out of the int/long range. One approach would be to count how many digits there are in the string and switch to BigInteger if there are too…
How would you initialise a static Map in Java?
Method one: Static initialiser
Method two: instance initialiser (anonymous subclass)
or
some other method?
What are the pros and cons of each?
Here is an example illustrating two methods:
import java.util.HashMap;
import java.util.Map;
public class Test {
private static final…