Using VI I edit some files in which I want to erase many lines I don't need anymore
usually I do something like that:
and it is doing fine
but in this case, the pattern to erase contains some special characters
so I do it like that:
but, the only problem left is that I can't predict what will be the beginning of the line so I wish I could do something like that:
but of course if I protect the pattern with # to prevent special characters to annoy me... the * don't work anymore
the best way would be to suppress each line containing my pattern, but I don't know how to do that
I'm sure it's pretty easy for many among you, so if one have a bit of time, it would help me a lot
Hi guys,
does anyone know how to test for a regular expression - i want to include it in a script to make sure the variable is a regexp
cheers (1 Reply)
What is the easiest way to get full address of *.jpg images from html file using perl?
example:
http://farm3.static.flickr.com/2397/2126443111_65a810004c.jpg (1 Reply)
I'd like to know if there is a catchall line for renaming the following patterns:
s01e03 -> 01x03
s4e9 -> 04x09
s10e08 ->10x08
and possibly even:
318 -> 03x18
1002 ->10x02
if its the first 3 or first digit number in the string.
thanks! (0 Replies)
Good Day,
Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp.
sed -n '/regexp/{n;p;}' filename
What if my regexp is 3 word or a sentence. Im... (3 Replies)
I don't want to have to resort to
/()/
though that does work.
Effectively, I need to be able to implement
/(?:(?:regexp1){0})(regexp2)\D/
to basically match regexp2 as long as it is present and regexp1 is NOT.
So, how to do
/(regexp){0}/
? (2 Replies)
Hi everyone, I would really appreciate any help I could get on the following topic.
I am not very familiar with reg expressions nor with sed, I just know the basic uses. What I am trying to do is the following: I have a huge text file where I would like to replace all occurnces of a certain... (13 Replies)
I would like to extract "1333 Fairlane" given the below text.
The word "Building:" is always present. The wording between Building and the beginning of the address can be almost anything. It appears the the hyphen is there most of the time.
Campus: Fairlane Business Park
Building:... (9 Replies)
Hello,
This is a problem I've worked on a while and can't figure out.
There is a file.txt
..some stuff..
]
]
..some stuff..
The Awk program is trying to extract the year portion of the birth and death ("98: and "2nd C.") using the below technique
#!/bin/awk
@include... (5 Replies)
ENIGMA(1) BSD General Commands Manual ENIGMA(1)NAME
enigma, crypt -- very simple file encryption
SYNOPSIS
enigma [-s] [-k] [password]
crypt [-s] [-k] [password]
DESCRIPTION
The enigma utility, also known as crypt is a very simple encryption program, working on a ``secret-key'' basis. It operates as a filter,
i.e., it encrypts or decrypts a stream of data from standard input, and writes the result to standard output. Since its operation is fully
symmetrical, feeding the encrypted data stream again through the engine (using the same secret key) will decrypt it.
There are several ways to provide the secret key to the program. By default, the program prompts the user on the controlling terminal for
the key, using getpass(3). This is the only safe way of providing it.
Alternatively, the key can be provided as the sole command-line argument password when starting the program. Obviously, this way the key can
easily be spotted by other users running ps(1). As yet another alternative, enigma can be given the option -k, and it will take the key from
the environment variable CrYpTkEy. While this at a first glance seems to be more secure than the previous option, it actually is not since
environment variables can also be examined with ps(1). Thus this option is mainly provided for compatibility with other implementations of
enigma.
When specifying the option -s, enigma modifies the encryption engine in a way that is supposed to make it a little more secure, but incompat-
ible with other implementations.
Warning
The cryptographic value of enigma is rather small. This program is only provided here for compatibility with other operating systems that
also provide an implementation (usually called crypt(1) there). For real encryption, refer to bdes(1), openssl(1), pgp(1)
(ports/security/pgp), or gpg(1) (ports/security/gnupg). However, restrictions for exporting, importing or using such tools might exist in
some countries, so those stronger programs are not being shipped as part of the operating system by default.
ENVIRONMENT
CrYpTkEy used to obtain the secret key when option -k has been given
EXAMPLES
man enigma | enigma > encrypted
Enter key: (XXX -- key not echoed)
This will create an encrypted form of this man page, and store it in the file encrypted.
enigma XXX < encrypted
This displays the previously created file on the terminal.
SEE ALSO bdes(1), gpg(1), openssl(1), pgp(1), ps(1), getpass(3)HISTORY
Implementations of crypt are very common among UNIX operating systems. This implementation has been taken from the Cryptbreakers Workbench
which is in the public domain.
BSD May 14, 2004 BSD