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.
I'd like to write a (korn) shell script that replaces the mv command so that it doesn't overwrite a file that already exists. I'd like it to function like the mv command so wish to type something like :
move /dir1/*.txt /dir2/
and have all files ending in .txt in dir1 moved to dir2 but only if...
I'm trying to create an Advanced Queue that has a payload type of an object type which has some attributes which are nested tables i.e.
CREATE TYPE TYP_TAB_VARCHAR60 IS TABLE OF VARCHAR2(60)
/
CREATE TYPE TYP_AQ_PAYLOAD AS OBJECT (
ATTR1 TYP_TAB_VARCHAR60 , ...)
/
EXEC...
I've been working my way thru' Steve Muench's excellent Building Oracle XML Apps book and was wondering why the following doesn't work as I think it should. I have an XML file, King.xml :
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="KingToXML.xsl"?>...
This is exactly what I had in my trigger but as I said earlier, the osuser column does not appear to be populated at the point the trigger is fired. This is what I have :-
CREATE OR REPLACE TRIGGER logonauditing
AFTER LOGON ON database
DECLARE
machinename VARCHAR2(64);
osuserid...
How can I capture the Operating System username from an AFTER LOGON ON DATABASE trigger in 8i (8.1.5+)?
I've tried select OSUSER from V$SESSION but it appears not to be populated at the point the trigger is fired.
What methodologies do you DBAs implement for auditing who signs on to the database...
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.