Programming :: Migrate Regexp From SED To AWK?

Apr 22, 2010

I have a sed script to search and replace a pattern on the next kind of text:

Code:
C/username/Mydocuments/games & music
C/username/Mydocuments/New files 09-17-2007
C/username/settings
The script is:
code....

View 9 Replies


ADVERTISEMENT

Programming :: Bash: Regexp In 'if' Doesn't Evaluate Correctly

Mar 1, 2011

I'm using an 'if' statement to check whether one of positional arguments is a word or a construction like "x-y", but something doesn't seem right.

Here is the relevant part of the code:

Code:
if [[ "$3" =~ [a-Z]-[a-Z] || "$3" =~ [a-Z] ]]; then
grepRange=$3; else grepRange=$4
fi
And for the input like this:

[Code]....

but shouldn't the $grepRange variable be blank in this case?

Bash version is 4.1.7(1)

View 6 Replies View Related

Programming :: Bash Regexp String Compare Stopped Working?

Oct 20, 2010

Have a bash script which contains a line like this:

if [[ ${array[${last}]} =~ "screenpc.PRODUCTION.*" ]]

which WORKED as expected in bash 4.0.33 and now fails in 4.1.2

Instrumented the script to print the value of the left-hand side and it is exactly what is expected.

As noted above, this has been working fine until we installed Fedora 13 (kernel 2.6.33), and now it fails.

Tried setting shell 'extglob' to On with same results.

Did something change? Are there other shell/bash options that need to be set?this has the whole installation stopped!

View 10 Replies View Related

Programming :: Write Regexp That Matches String That Begins With Whitespace Or Contains Newline?

Dec 10, 2010

How do I write a regexp that matches a string that begins with whitespace or contains a newline, but not necessarily both?

View 2 Replies View Related

Programming :: Inverse Regexp Matching / Developing Of An Idea 'pattern Based Filtration'?

Sep 3, 2010

I am interested in the following problem: given a string (pattern) find a regexp which match this pattern.
I will need this for a developing of an idea 'pattern based filtration'.

View 3 Replies View Related

Programming :: Sed Delete Lines From File One If Regexp Are Listed In File Two?

Sep 17, 2009

I am trying to delete lines of a file if they contain text that is present on another file. For example

> cat one.txt:

a
b
c
d

[code]....

I get the following output:

> ./test.sh one.txt two.txt
a
b
d
e

[code]....

View 6 Replies View Related

Programming :: Migrate DB From COBOL To Postgresql?

Jun 27, 2011

Is there a software or procedure to migrate DB from COBOL to SQL ( or postgresql)

View 10 Replies View Related

Ubuntu :: Regexp R-search In Bash

Jul 13, 2010

What keyboard shortcut will give me a regexp reverse search in bash? Or does C-r supply something like that already that I can't figure out?

View 4 Replies View Related

Software :: Sed And Regexp For Search In Multilines?

Sep 24, 2010

I've a text file which have a structure like:
<managed-data-source .....
name="nameDS"
/>
<connection-pool ....
code....

If you execute the previous command, you will see that it also displays connection-pool lines.

View 10 Replies View Related

General :: Install Regexp Enabled 'rename' On Fedora?

Jun 26, 2011

I have a batch rename task and I find the 'rename' command in Ubuntu and Fedora is different.In Ubuntu, rename is written in Perl and has regexp support. Is there anyway to install it on Fedora?

View 1 Replies View Related

Ubuntu :: Bash ${variables} : Replace Last Instance Of Regexp?

Mar 10, 2011

I have something like...

Code:
var=beer
# echo ${var/%e/E} doesn't do anything because i can only replace "r" or "er" this way

[code]....

View 1 Replies View Related

Server :: Postfix Mailserver Randomize Transports Using Regexp (using N)?

Jun 5, 2010

Im using posfix as a outgoing mail server, here i want to distribute the mails to different ips to avoid the ip blacklisting. I found a solution by using multiple transports , but here one thing blocking me was i could not able to select a transport using regexp or pcre matching pattern, log says that

Code:
Jun 5 07:12:49 server postfix/trivial-rewrite[6079]: warning: pcre map /etc/postfix/transport.pcre, line 1: regular expression substitution is not allowed: skipping this rule

the transport used for this purpose is:-

Code:
#cat /etc/postfix/transport.pcre

/^.*@([a-z])ol.com$/ transport$1:

View 2 Replies View Related

General :: Use Regexp In Diff / Exclude Lines That Contain The String "[skipthisline]"?

Feb 10, 2011

I need to compare 2 files using diff. The problem I've encountered is that I need to exclude certain lines that contain certain phrases. I know that diff supports the -I switch but no matter how I try to form the regexp it doesn't seem to work the way I expect it to. If anyone has used the -I switch before could you please post some examples of how it is used.

diff -I "[skipthisline]" file1 file2 > output.diff

I need to exclude lines that contain the string "[skipthisline]" but I have no idea what syntax is used after the -I switch. Is is supposed to be included in quotes or slashes /[skipthisline]/ or entered without either? I need to include a backslash before each bracket so that it's not interpreted as a set of characters like [a-z] but is instead interpreted as a string. Do I need to use 2 backslashes? "\[skipthisline\]"

Is it sufficient to simply type the string I want to match or do I need to match the entire line in order to exclude it from the output?

.*[skipthisline].*

or

^.*[skipthisline].*$

View 2 Replies View Related

Fedora :: Migrate VMware To KVM?

Jun 11, 2009

Is there any means of converting a VMware VM into a KVM VM? If there is no direct way is there a KVM tool that will convert a running system into a KVM VM like VMware has? If that exists it would be possible to run it on a VMware VM to produce a KVM VM?

View 14 Replies View Related

Fedora :: Migrate On A Bigger HDD?

Jul 24, 2010

I have Fedora on SATA HDD 80Gb.Now I want to move all partitions to the 500Gb one.Some of partitions will remain the same size, some will increase. I tried that with Paragon Hard Disk Manager,but after it was done I found a problem, that they can't pass fsck checkup.It says something about cross linked files and on the root partition it failed at all with warning something about bad superblock.what is the easiest way to move to the big HDD? What soft should I use? Maybe it's sufficient to boot from CD, create new partitions and copy all files from source partitions to destination ones?

View 3 Replies View Related

OpenSUSE Install :: Migrate From 11.2 To 11.3?

Jul 20, 2010

I am using openSUSE 11.2 on my work computer and I wanna migrate to openSUSE 11.3. My concern is the fact that I have some "must have applications" that I had a lot of problems with them at installation on 11.2. Is there any possibility to create something like a restore point and if these applications are not functioning to come back to 11.2?

View 7 Replies View Related

Ubuntu :: Migrate To Another Partition?

Aug 11, 2010

It's me again, I wish to be a little more organized. I incidentally installed Ubuntu on the same partition as my main Windows 7.

Is there a possible way to "migrate" this Ubuntu OS to another partition, keeping all of the settings. Also, would "migrating" the OS interfere with GRUB2?

View 9 Replies View Related

Ubuntu :: How To Migrate To Ext4

Dec 19, 2010

I'm running Ubuntu 10.10 x64 and have been using an encrypted ext3 setup (created with the alternative installer CD) ever since Hardy or so. Is it possible to migrate my partitions to ext4 without formatting/reinstalling ?

View 1 Replies View Related

Red Hat / Fedora :: Migrate Script From HP-UX?

Mar 1, 2011

I have created some new weblogic domains in linux machines and I migrated the related scripts. All works ok but the following.

In stop script it seems that after the execution reaches the following command (which performs the actual shutdown of the server) the script lets say that it pauses(?) its execution. The server is actually stopped, but I found that to continue to execution of the script I need to hit Ctrl+C or Enter. I seems that some sort of user interaction is required.

The command is the following:
Code: ${JAVA_HOME}/bin/java -cp ${CLASSPATH} weblogic.Admin FORCESHUTDOWN -url ${URL} ${UIDPWD} ${SERVER_NAME} 2>&1 I am positive that all parameters are defined correctly. After all the script works. The only thing that comes to mind is the 2>&1 for redirection of the output. Could this need different syntax?

View 1 Replies View Related

Fedora :: How To Migrate From Ubuntu

Nov 17, 2010

I have used Ubuntu for 4 years. I'm thinking of trying Fedora. I have a 1TG HD with three partitions(/,/ home, swap).Any suggestions about how to migrate? Do I clean /home of programs files? Just my personal files? Etc.

View 4 Replies View Related

Server :: Migrate DNS Records From Old To New?

Nov 3, 2009

Our hardware that is running DNS is very old (Pentium 1 Redhat release 6.2), and I want to migrate the DNS Records to a new computer (Pentium 4 Debian Lenny). There is no GUI environment on the old server: no Gnome or KDE. I may consider using VMware Workstation for this project.

1. I don't have very much DNS experience. Is this a painless process?

2. Are there commands that I can run to export the DNS records from the old server?

3. Are there commands that I can run to import the DNS records to the new server?

4. What other advice do you have that could help this process?

View 2 Replies View Related

OpenSUSE Install :: Migrate KDE 11.2 Settings To 11.3?

Jul 16, 2010

I installed 11.3 as a "fresh" install (not upgrade) into a second partition, so now I have both my current 11.2 and the new 11.3 as a dual boot.

I'd like to migrate my old KDE (4.4.3) settings to the new 11.3 (KDE 4.4.4) installation, most importantly KMail and its archived mail folders. My plan was to copy the kmailrc file from the ~/.kde4/share/config/ folder and overwrite the default kmailrc that's on 11.3 and then replace the ENTIRE ~/.kde4/share/apps/kmail/mail/ folder on 11.3 with the one on 11.2 (including the hidden files and folders).

My questions are:

1. would this work, or am I missing other files and folders.

2. Would I be better off just copying the entire ~/.kde4 folder from 11.2 partition to 11.3?

View 3 Replies View Related

Ubuntu :: How To Migrate Email (One Web Host To Another)

Jan 23, 2010

I was not sure if Desktop meant 'Desktop vs Server', or Desktop as in relation to Windows Managers.

I want to move a domain from one web host to another. I also want to preserve my email. Does anyone have a recommendation for software which will allow me to:

(1) Copy current web host email locally
(2) Switch web hosts
(3) Populate new web host with local copy

I've looked at imapcopy and imapsync. Unfortunately, both want Server -> Server. I briefly looked at setting up a local IMAP server (dovecot-imap), but it is clear that this is more ISP-grade. I did not see a quick example of user management in [URL], and I don't really want to spend days working on the configuration.

Any recommendations for software that allows me to 'backup' and 'restore' to/from a local file store?

View 5 Replies View Related

Ubuntu :: Migrate User From Old Install

Jun 2, 2010

I'm moving a user from an old 8.x Xubuntu install to a different machine with 10.04 installed. I want to migrate all the user's files and settings to the new machine. I see Ubuntu has a migration assistant, but the limited documentation I've found on it talks about using for in-place upgrades from older/other OSes.

Ideally, something like this would work like the Apple Migration Assistant or Windows Easy Transfer. If so, how do I access this? Anyone have a tutorial? If not, can someone point me to instructions to move the proper folders, create the user, assign permissions, etc.?

View 3 Replies View Related

Ubuntu Installation :: How To Migrate To Kubuntu

Jun 3, 2010

I have recently tried to migrate to kubuntu. I am reading manuals and studying the matter right now, trying to find help via googling and stuff, but for some (i suppose, trivial) matters i just cannot seem to get help and reading manuals leads me nowhere.I am sorry if my questions seem trivial or are answered in manpages or on this forum, i tried searching and didnt found...

1) how to correctly install something, for which a "Stable Source Release" is provided. Especially when options are to be set

2) how to get knowledge about what version of something (in this case, ntfs-3g) is installed in my system, and what kind of options were set when it was installed

3) what exactly happens when i type "make" withing a folder i just extracted my "stable source release" gzip to?

4) what exactly happens when i type "make install", how does it know where to put what files, make changes to my system etc...

5) how to undo what it (make install) has done (because i had already corrupted one installation of kubuntu by simply doing an unsuccessfull make install of an x-fi driver package and then an alsa package)

6) when i install something with "apt-get install <packagename>" does the downloading of "source stable" happens and "make install" is ran for me, or something else?

7) Do gui package managers just do the "apt-get install <package name> " for me when i check to install something or do they do something extra aside from that? Like synaptic?

8) when i install something with the same name, but different version, what happens? like if i do an "apt-get install XYZ" of version 2.0 when i already have XYZ of version 1.0 installed, will 1.0 get overwritten by 2.0 or will i have both installed in my system?

9) how do i know which "options" are used when i do apt-get install of a package? for example, if package says "build with this option to achieve this result" how do i know if this option is on or off or can i control it when i apt-get install this package?

10) if i installed something with "make install" - can i later uninstal if with apt-get uninstall package or i have to somehow manually remove files? what is the common procedure?

11) if i installed something with "make install" - can i later upgrade it with "apt-get"?

12) why i read in books, like for example here (http://rute.2038bug.com/index.html.gz), that i should partition my disk in multiple partitions:

- one for swap
- one for / file system
- one for /usr
- one for /tmp
- one for /var
- remaining space goes for /home

because then if one gets overflown, full or broken, it wont affect the others, and you can afford to loose some and it eases the recovery of system in case of a fault
but then, kubuntu installs itself just in two partitions, swap and the rest? Is multiple partitions scheme outdated or?

13) Why if i ctrl-alt-f1 out of my KDE and run kate (any gui program), it says "cannot connect to X server" while xserver is indeed running on my pc (otherwise how would kde work?)

14) what is under ctrl-alt-f12, f11 etc, it is a blank screen with a cursor in top-left

15) is there a way to set the vga mode for tty's that are accessible with ctrl+alt+f(1-6) to 80x50 (i prefer that over the 80x25 that is set by default there)
i've read that you could do that in lilo config files you just do vga=extended
but now kubuntu uses grub so... how do i do that?

16) i've read that "linux is good because you can shut down an app that hangs your pc by going to terminal and sending a kill signal, something you cannot do in windows because windows has no way to escape a frozen gui"

But when i had a way to test that in practice (today i tried some decoration scheme for my KDE and it froze my desktop) i found out i have a freaking lot of processes running (with ps -A) and.... well, what should i have done to unfreeze my desktop? And how do i know what exactly hangs my PC in order to terminate it? (like in windows - you very frequently have a nearly dead non-responding pc, but doing CtRL-ALT-DEL shows that "system idle" has about 3/4 of your processor time and there is no problem with memory consumtion either, yet system barely can respond to your input")

17) i've heard and read about "linux needs no reboot" but in practice, installing nvidia drivers requires reboot, for example. So, is it really true or there is a way to make those drivers go without rebooting, they just tell me to reboot because i'm considered a newbie who doesnt know that "linux does not need reboot"?

18) KDE is very annoyingly preventing me from doing anything in "LEAVE" menu without a 30second-confirmation box (shutting down in 30 s...)... and i dont seem to see any settings for that in the gui... same goes for asking me to close my tty's - can it do it by itself? what config file should i edit?

19) As i read, linux filesystem philosophy is that settings go into /etc and that everything is a file, so, in order to change anything in my system it boils down to editing a file. Now, why do the files are so scattered? For example, why does alsa config file live as a hidden file (starts with .) in my home, and a file to set up mounting behavior lies in /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla or /usr/share/polkit-1/actions/org.freedesktop.udisks.policy.

Do only system apps like mount use /etc for their configs, and how do i generally know where to look if i want to change something (like in windows, i'd go look in the application path, in my user folder's corresponding folders - my documents, application data etc and in registry).

20) As i read, linux ideology is about program scattering istelf all over the file system. Countrary to windows where program occupies a folder in which it nests its own folder tree (like data, sound, themes), a linux is said to put binaries into /bin, configs into /etc and so on. What happens if programs are called the same or use same files? For example, if two people make a program with a same name or use same file (for example, alot of windows programs used to use settings.ini to store user settings, if that would be in a same folder...?) or make a same short name for their program (like a long program name abbreviated to three letters for simplicity, but what if two programs have same abbreviations?).

View 6 Replies View Related

Ubuntu :: Unable To Migrate To New Partition?

Oct 4, 2010

I want to change my partition configuration, and migrate my install to a drive I haven't used in a while.I've followed the steps which I have seen in several locations, but for some reason I can't boot into it (hopefully it's something simple )Here's what I've done so far:Deleted all of the partitions on the drivecreated a new EXT4 and swap partition on the drive (and others that are currently unused)mounted the new drive, and rsynced the old drive with this command:

Code:
sudo rsync -va --exclude=/media --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --progress / /media/ubuntu

[code]....

View 4 Replies View Related

Ubuntu :: Migrate To New Hard Drive?

Jun 9, 2011

I'm about to migrate from a single 1TB drive on my Mythbuntu system to a two-disk setup with a 500GB drive for boot, root, home, etc. and the entire 1TB drive reserved for MythTV and shared videos.

In addition to being on a different hard drive than now, the partition numbers are somewhat wonky currently; I originally dual-booted Windows on sda1, which will no longer be the case. sda2 is the current myth partition and is the back half of the drive for some reason I won't go into here. Partitions 3 through 7 work all right now as root, swap, home, and space reserved for a virtual machine, but I'd like them to be 1 through whatever just for keeping me sane.

Is there a good way to do this? I was going to use remastersys to install my current install there, but I'm not certain all the data I need for a seamless install will fit on the 4 GB jump drive I have. I can mount the old partitions and copy some stuff over afterwards, but it would be nice if there were a way to just dump it on and have it mostly work. I've had to jump through some hoops to get it working the way it is now (which is quite well) and I'd like to avoid doing that again. Plus, with MythTV, there's a lot of setup involved after installation which I'd like to avoid since it's correct now.

If there is a good way to clone the partitions to the new drive, a big thing would be that the boot sector has to come over too, or can be rebuilt without needing an install. I've had a situation where that didn't happen, and the result was a lot of wasted time and effort.

View 8 Replies View Related

Server :: Migrate DB From Lotus To MySQL?

Sep 11, 2009

I need to migrate data from Lotus Notes (LN) to MySQL system. I googled around, but didn't find much information about it. The LN has an option to export data like Lotus 1-2-3, which allows you to open the data into excell, but nothing apparently to MySQL. I also opened the MySQLMigration-ToolKit. In the import DataBase System, it doesn't appear LN as an option of supported systems. We are trying to keep things using freeware and cross-platform, although sometimes providing final customer products that run on MS. There is any tool available around, or should we go and code the routines to read the tables from Lotus to MySQL using a programming language like C?

View 3 Replies View Related

Server :: Migrate Some Mailboxes Using Postfix?

Nov 8, 2010

I have postfix and mysql set up on one server running Ubuntu 6.10. I have to upgrade all them at their current versions and ensuring current email service on line. So, I installed in other machine the current versions of the same programs. The oldest server is the current MTA, the new machine is on line but I don't know where I should make changes that allow me move some mailboxes from one to other. I tried reassigning priorities in them MX's records but it didn't work.

View 1 Replies View Related

Server :: Migrate The Database With This Commands?

Feb 15, 2010

I'm migrating a mailserver from an old to a new mailserver. The new mailserver is based on ISPConfig 3.0.6.1.

I would like to migrate what spamassassin learnt in the past from the old mailserver to the new one. Now the question:

- The 2 spamassassin versions are different. Is it a problem?
- Can I just migrate the database with this commands???

Code:
sa-learn --backup > sadb.bkp
sa-learn --restore ./sadb.bkp

-how to migrate SpamAssasins Auto White List and all others SpamAssassins databases?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved