General :: Finding And Deleting A Sequence Of Letters ?
Dec 6, 2010
I'm trying to write a script to do the following:
I have a text file that contains many lines that look like this:
I'm trying to make my script read this text file, find the string sequence "QIEN", and delete everything from this sequence backwards (including "QIEN") so that the above lines look something like this:
I'm aware that grep is good to do a regular find-and-delete as follows:
Code:
But this will delete everything on the lines that contain the string sequence "QIEN".
I tried googling around but i cant find anything related to this: everyone seems just interested in random numbers, so when it comes to random letters there is a lack of informations. However, i am trying to figure out a wait to get a random letters string that matches a simple rule: it must be a sequence of consonant+vowel. So for example, these are some 6 letters strings i would like to obtain: wolupa, tafoke, zewevu, cupimo.
Although I tried to upgrade from Fedora 14 to 15 using Pre-Upgrade, my system does not find Fedora 15 at the end when the Pre-up-grade sequence. On the very last step when Pre upgrade reboots my computer it just goes straight back into Fedora 14. No choices (Fedora 14 or Fedora 15 Upgrade Kernel) are shown.
I copied a back up of my windows 'my documents' fold and all of its' sub folders into my linux (Mint Debian) Documents directory. I found that many of my files can be found in more that one directory so, what I want to do is to find all the dups and deal with them. Is there a good linux application to resolve this 'duplicates' problem. (I don't want to touch the linux system files.)
Recently I faced a problem in typing in English in OpenSuse 11.3.When I try to type in English it shows me Greek letter and worse than that I think it is really Greek (not only in font) because when I enter my passwords or try to type a command in terminal I get error,I tested with UK and USA and all other English languages and I still have this problem. I even do reset in my keyboard layout setting and in KDE setting but it didn't help.
We have an issue like this: We print PDFs from a Linux box to a printer attached to a Windows machine. Problem is when we print from the Windows the printout comes perfectly with the font bold and clear, but when printing from the Linux box the font is very FAINT and we can see dots in the fonts.
We tried changing the PDF to a text file (i.e. we created text file with the report) with the -o cpi=5 option and still it does not come out properly. Now the font gets bigger, but we can see dots in the font and it is not bold.
I've recently purchased a VPS to run a private server on. I installed gnome and configured it to run on TightVNC to access from my home computer. Whenever I try to type certain letters such as a lower case "s" it instead accesses the shutdown menu at the top right corner. This is disabling me from finishing my server and downright frustrating.
Why is the Linux boot sequence is organized the way it is?Power on + BIOS runs hardware initialisation and self tests, LILO/GRUB etc... but why is it organised the way it is?Would I be right saying it is primarily for debugging purposes?
Is there a way to interrupt the boot sequence, or execute it line by line? Alternatively, after a command has executed and the scree fills up, is there any way to "page up" on the screen?
Using a Linux program to fix my TiVo. Program is burned to a bootable CD, which loads fine. I get asked what the drives are (CD and Hard Disk) with abbreviations like hda, sda, etc. I was able to determine the Hard Drive as /dev/sda, by using <Shift>-PgUp/PgDn, but could not find what the CD drive was.
I use debian 6.0.0. I have installed scim scim-m17n scim-gtk2-immodule m17n-db im-switch. I can write hindi fine in browsers & gedit using transliteration. In vim I see that matra & letter are not positioned correctly. Here is screenshot post.jpg. I am using 'Akshar Unicode' . 'Monospace' does not help either. Otherwise , what font you use?
And I want to be able to pipe it to sort on that third column, by letter first, then number. But I keep coming getting files sorted like:
(field separations all start at same place, so columns are not jagged like above.)
I have read the sort man pages, and have tried -n for the numbers, and -k for the position to start sorting, among other things. I also tried inputting a second position to start sorting, which sort should supposedly refer to if the two entries are identical at the first place being compared, but it seems to just ignore the second one. I just can't get it to sort the numbers properly...
For now I am manually opening the file in emacs and changing them around, needless to say, very time consuming.
I have an external drive mounted courtesy of an entry in fstab. The drive isn't detected at boot time until AFTER the backuppc service that will use the drive has started. I have to therefore manually stop and restart the backuppc service once booting has completed, otherwise backuppc thinks there is no drive available to it.
How can I force the mounting of my external device to occur BEFORE the backuppc service starts?
I'm creating a bash script that contains the following line:"ssh user@$server1 cd /tmp; pwd"What I want is to print /tmp of server1, but the script it isn't printing that
figure out the best partition layout for my linux installation which I'm about to have on my laptop. Having read numerous articles on partitioning in linux I've gathered some ideas, still there was no let's say a clear explanation as to the sequence the mount points should be arranged on the disc...What I have in mind is to use a single disc space as efficiently as possible considering the head travel. The pc is a laptop, 160GB HDD and will be used as a normal desktop with some simple sound processing. Distro Linux Mint 10. I'm planning to have such partitions and all will come after a Win7 installation:
/boot -> some write it's not necessary in dual-booting, some that it's good to have for security swap -> with 4GB of RAM i don't suppose i'll use it /
[code]....
have the most heavily utilised partitions close to each other so the head doesn't move for large distances. The placement also makes a difference as the closer to the inner rim of the disc the worse performance. I'm also not sure about the sizes. Read posts with recommendations but still judging by installations on a different laptop and virtual machine e.g. 5GB for /opt is a bit too much as there's almost nothing in there. Certainly /usr fills up, /var too from what I've observed. / also has scarce data in it so I'm wondering if giving them e.g. 5 gigs each won't be a waste of space resulting in greater head travel.
I have a box with Novell Suse linux installed. It asks for username and password I do not have and cannot figure out. I also have a SantaFe distro CD with which I would like to replace the Suse on the box. I cannot get the box to BIOS to change the boot order to boot from CD. I would like to break free of Windows, but can't seem to get there from here...
I'm currently using an external screen with my laptop at home connected with a serial port. When I'm in X, my laptop display is automatically disabled, when the external screen is connected. Is there a way to do this also at boot time? Where do I have to configure this? Also I'd like to have my login shells on my external screen, when switching to them out of X.
I am trying to find a way to replace a set of sequential numbers in a file with a different sequence using sed. This might be done easier using awk or some sort of bash script, but it seems to me there must be a way to do this easily with sed. Basically, what I am editing is a Cisco switch config. I want to change the sequence of ports to a different numbered sequence. Here is an example of what I am trying to do.I want to change for example, the file: