If this is easier than I think I'll kick myself.
I know that I can delete all lines that match a pattern with
sed -e '/<pattern>/d' input > output
But how do I delete the line containing the n'th occurrence of the pattern only.
Thanks
cardy
I'm trying to write a wsadmin (jacl) script that will "interrogate" an application for its installation options prior to uninstalling and then re-installing it with the same options. Any help or pointers would be appreciated.
Cheers
Cardy
A variation on aigles solution (without the output_file):
head -1 input_file; tail +2 input_file | sort -u
or put this in a script (called, say, nsort)
head -1 $1; tail +2 $1 | sort -u
then run
nsort input_file
Does anyone know of a gui version of the tail command (I've only come across windows versions so far). I would preferably like it to have a highlighting feature and possibly the ability to tail multiple files at the same time.
Anybody know why, when I parse the following -
<foo>fred & amp; barney</foo>
I get barney instead of fred & barney
i.e. the ampersand and the text to it's left are lost. The same happens with " and I suspect will happen with other entity references.
Please note - I had to put a space...
sushveer,
I tried this but it is still not working. No matter what character I use, it won't interrupt my process. I just get the control character displayed e.g. ^C. Other control characters seem to work, e.g. ^Z to suspend the process.
Any other ideas?
Cheers
Cardy
I have a Cobol program that I would like to call from a C program. The linkage section of the Cobol program has some numeric fields defined as :-
FIELD1 PIC S9(9)V99 BINARY.
FIELD2 PIC 9(7) BINARY.
I'm having trouble passing values for these numeric fields into the Cobol program. I have...
I have created a JPanel and set its layout to BoxLayout with components laid out from top to bottom. I then add buttons to the panel but the buttons are centred within the column-shaped panel. How do I get them to "float" to the top ?
TIA
cardy
Thanks Greg, we seem to be getting somewhere. I'll use this idea for now but if someone can come up with a way of doing it like mv does it (i.e. specifiying the destination as the second parameter) I'd be very grateful. I'm trying to replace the mv command for the users (who are constantly...
Thanks crowe but have you actually tried running this. Yes it works OK if you say
mv file1 file2
This moves file1 to file2 only if file2 does not exist, but what if you say
mv x* sub
i.e. move all files beginning with x to the directory sub. As I said above when you specify wildcards for the...
Thanks for that DumTech but you haven't quite grasped my problem. Let me try to explain. I want to be able to type
move a b
where a is either one file (in which case b can be a file or a directory) or a number of files using wildcards e.g. *.txt (in which case b must be a directory). In my...
Thanks Greg but the problem with mv -i is it requires a response. I'd just like to have any files that couldn't be moved (because the destination file already exists) reported on and skipped, without any user intervention.
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.