General :: Substitute In A File When Sed And Awk Both Fail ?

Jun 5, 2011

I have tried making this substitution using both of

Code:

Sed operates with no comment but does nothing. awk objects to the variables content because they include the occasional non-breaking-space. The presence of these is essential so that bash will properly distribute the content of each line to an array.

The content of "orc" and "orch" is as follows (the non-breaking-spaces show as *).

Code:

View 2 Replies


ADVERTISEMENT

Programming :: Substitute Text From Master File?

Mar 29, 2010

i have a PHP program, it encompasses about 200 scripts. Years ago, it was rewritten by another programmer to be multi-lingual, but the multi-lingual attraction of it never took off. Now that I am the only maintainer, trying to reuse what I have for code is quite difficult. If I look at one script, I see items like

_HEADER_TEXT_ERROR_4
_TABLE_ROW_SIZED_FORMAT
_ERROR_SELECT_RADIO_MAIN

All of these (and many more) are found in a "main.php" file that sort of go like this:

DEFINE _HEADER_TEXT_ERROR_4 "You Entered a Bad Value";
DEFINE _TABLE_ROW_SIZED_FORMAT "Last Name";
DEFINE _ERROR_SELECT_RADIO_MAIN "Make Your Selections";

What I would like to do is have something that says FOR all files in this directory, when you find something that starts with _, find that value in main.php and substitue what is inside the quotes for that value. Sort of unwriting all this multi-lingual stuff. I can format how I would do it if it was all stored in MySQL, but doing it from bash has me perplexed.

View 11 Replies View Related

General :: Substitute In A File What It Comes With "(" Character To "?

Apr 21, 2010

i want to substitute in a file what it comes with "(" character to "('". i have tried to do it with gsub but it doesn`t go well with regular expression.

View 4 Replies View Related

General :: Substitute Pattern With Another Patter In Vi

Apr 24, 2009

I have the large file (textfile) there are word:

code-007100
...
code-007199

How to substitute those all words, so it will change all instances to:

code-007200
...
code-007299

View 5 Replies View Related

General :: SED - Substitute A Word Only In A Certain Line

Feb 2, 2010

I tried to use the command:

sed -i ''$line_number',/port/s/port/portMARKED/' file

to substitute the word "port" by the word "portMARKED" at the specific line that is saved in "line_number". The substitution happens, but it is copying my line twice... and I have no idea why... I need to make a single substitution of one word for another at a certain line in my text file. Would somebody know how I could do that?

View 3 Replies View Related

General :: Substitute Variable In Bash

Mar 21, 2011

Assume that i a having the following three lines in an executable file

#/bin/bash
a=Tue
Tue=1

When i give echo $a the value should be 1, how to do this.

View 8 Replies View Related

General :: Bash: Substitute Parameter In A Quoted String - Stored In Another Variable

Jan 31, 2010

(variable substitution?)
(parameter expansion?)
Code:
run_repeatedly()
{
NUM=0
while [ <irrelevant stuff here> ]
[Code]....

run_repeatedly "programX -o "./messy/path/output-$NUM.txt"" The echo inside the loop prints "...-$NUM.txt"; obviously I'm aiming to have bash substitute the iteration number so that I end up with many output files not 1.

View 5 Replies View Related

Server :: NFS Large File Copies Fail - Error Writing To File: Input/output Error?

Jun 27, 2009

I recently upgraded my file/media server to Fedora 11. After doing so, I can no longer copy large files to the server. The files begin to transfer, but typically after about 1gb of the file has transferred, the transfer stalls and ultimately fails with the message:

"Error writing to file: Input/output error"

I've run out of ideas as to what could cause this problem. I have tried the following:

1. Different NFS versions: NFS3 and NFS4
2. Tried copying the files to different physical drives on the server.
3. Tried copying the files from different physical drives on the client.
4. Tried different rsize and wsize block sizes when mounting the NFS share
5. Tried copying the files via a different protocol. SSH in this case. The file transfers are always successful when I use SSH.

Regardless of what I do, the result is the same. The file transfers always fail after approximately 1gb.

Some other notes.

1. Both the client and the server are running Fedora 11 kernel 2.6.29.5-191.fc11.x86_64

I am out of ideas. Has anyone else experienced something similar?

View 13 Replies View Related

General :: Substitute For Nokia PC Suite Or Synchronizing Data From A Nokia Phone

Apr 1, 2011

I was looking for a way to get the same or similar functionality as the Nokia PC Suite on Ubuntu 10.04. I did find a discussion here [url].

However it is fairly old (2008). I was wondering if it is possible to get more recent information.

In the Ubuntu Software Center I find two applications that seem to fit the bill. I need to know which is better or are the complimentary.

View 3 Replies View Related

Ubuntu :: Mount Of File System Fail?

Jan 28, 2010

When I try to boot into Ubuntu I get this error message:t of filesystems failed.3d82d6-5dcb-494b-b2f0-fe9f157e9430Any ideas on how to fix it? I have a duel boot with XP and Ubuntu 9.10.

View 9 Replies View Related

Ubuntu :: Txt File Association Fail On Fat32?

Sep 15, 2010

I have a Windows 7 partition, a fat32 partition that I use for moving data between Windows and Linux, and an Ubuntu partition. On the Ubuntu partition, I can right click on a text file and the top of the menu says "open with 'gedit'." On the fat32 partition, the same action says just "open," and the "open with" submenu doesn't include gedit.

If I right-click and choose properties on the same file, the "open with" tab shows gedit as the default file association. So that's weird... anyone else seen anything like this?

View 2 Replies View Related

Ubuntu :: Fail To Mount File System?

Feb 9, 2010

have been using karmic studio for around a month now, and have been recently experiencing some boot issues where 1 of 3 things are happening;1) failed to mount filesystem, where maintenance shell is initiated2) insert boot media and press any key to continue3) i get to log in and everything looks ok until i click the application menu, where nothing appears and all logos (shutdown/log off etc) appear as red crosses

View 9 Replies View Related

Programming :: Substitute Every Occurrence Of "( S" To "(S" In File

Mar 11, 2011

I want to substitute every occurance of "( S" to "(S" in my file (the quotes aren't included in my file. Its just there to specify what my pattern is)

This is my attempt to do it and the error message I get.

Code:
denish@ubuntu:~/Desktop/tgrep files$ sed 's/^( (S$/(S/g' test > test2
sed: -e expression #1, char 16: Unmatched ( or (

The "( )" has a different purpose in sed. So how exactly do I specify a ( in sed as a pattern and not as the special function?

View 7 Replies View Related

Ubuntu :: File Checks Fail For /home Partition?

Feb 28, 2010

I have a dual boot with Arch linux that share a /home partition. Whenever ubuntu starts tho it tries to do a check on the /home partition and fails.... it gets an error saying unable to check then drops into a shell. I have to run it in recovery mode frequently then start it up and it usually works, but i have to type startx after logging into a shell before that

View 8 Replies View Related

Ubuntu :: Zabbix GUI Installation - Configuration File: Fail

Dec 23, 2010

I installed the server and client from the repositories. I got version 1.8:

[Code].....

Got everything running, apparently normally, but then I noticed the GUI Installation tab. This helped me optimize the php.ini file so the pretty front end could be used. I got the step 7 where it says

[Code]....

View 1 Replies View Related

General :: Vim: Substitute For Page Up And Page Down Keys?

Aug 11, 2011

Vim: substitute for Page Up and Page Down keys?

View 4 Replies View Related

Programming :: [Perl] Fail To Sort A File With 300,000 Lines By Multiple Columns?

Nov 10, 2009

Each line of the file I am sorting is in the following format:

<url> <month> <day>

For example:

[URL]

I wrote the following to sort:

Code:

#!/usr/bin/perl
$in = shift;
chomp($in);

[code]....

The script worked fine for my small testing files, but failed in my input file. The input file is 18MB and containing more than 300,000 lines. The output will contains some lines like that:

url_one 10 1
url_two 10 1
url_three 10 3
url_four 10 1

Is that because my file is too big for perl to handle ?

View 10 Replies View Related

Ubuntu :: Permission Denied - Fail At Sudo /usr/lib/nx/nxsetup - Install - Due To File Is Missing

Feb 28, 2011

I am installing ubuntu to amazon EC2 by following the steps at [url] The installation works fine.

Then I want to gain Remote Desktop Access to Ubuntu, so I follow [url]

However, fail at sudo /usr/lib/nx/nxsetup --install due to this file is missing.

I then use putty, navigate into /usr/lib/nx to run command below.

wget [url]

But, it always come out with permission denied issue

I also try to upload the .tar.gz file via winscp to any of the possible directories.

All fail with permission denied issue.

Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 3

View 1 Replies View Related

Ubuntu Servers :: Looking For A IIS Substitute?

Jan 31, 2011

I am setting up an ubuntu server, and i was wondering if there was a program that i could apt-get that would manage my Domain names and create directories and FTP and all that good stuff like IIS does in windows. While i am fully capable of editing the files and working the server through the terminal, noone else in my office is and if we are to switch to a linux server they will need to be able to work it.

View 9 Replies View Related

Software :: Package Is Substitute Of The PHP-GD?

Aug 24, 2010

I would like to install GD package on my ubuntu , but as my ubuntu is too old that many library is required to upgrade when install GD , is there other package is substitute of the PHP-GD ?

View 2 Replies View Related

Programming :: Sed Substitute Everything Until Character?

Mar 30, 2010

I have the following file:

Code:

1 line
...
49 test test=AA:AA:AA:AA:AA=0

I need to substitute on the line number 49, all text until =. I have used the following, but with no actual result.

sed -re '49s/^.+=//' file
and
sed -e '49s/.*[=]//' file

View 5 Replies View Related

Ubuntu :: Substitute For Intrepid Repos?

Jan 5, 2011

Is there a substitute for Intrepid repos? I'm not able to access a few servers and don't want to upgrade the OS on this box.

Code:

View 4 Replies View Related

Ubuntu :: 11.04 - Substitute For CPU Scaling Applet?

Apr 29, 2011

Since the new Unity in Ubuntu 11.04 doesn't work with applets, like GNOME, I've lost an useful applet to choose the operating clock of my CPU as well as power profiles (Performance, Conservative, On Demand etc.).

I've looked into Ubuntu Software Center but couldn't find anything similar.

View 9 Replies View Related

Red Hat / Fedora :: What Is The Substitute For RHEL Repository

Feb 21, 2011

What is the substitute for RHEL repository? I know that we can use cent-OS/ fedora repository, but can someone please tell me what exactly is required in the yum.repo file. My computer details are as mentioned.

$uname -a
Linux example.com 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386 GNU/Linux[/B]

View 2 Replies View Related

Programming :: Substitute Text In Many Files?

Mar 11, 2010

I have this PHP Program I have been hobbying for years. Started in old PHP3 early PHP4. So with the newer PHP, things are starting to break! I have this string:

session_is_registered('UserID')

And I need to convert to this:

isset($_SESSION['UserID'])

in more than 200 scripts in my directory. I have been toying with perl (in a copy of the dir of course in case I really screw things over, lol) but am not gettig too far. The new code needs to swap ( ) for [ ] and i'm just all hung up! I am getting lost in Perl, I have this, but it does not substitute so I am missing something:

perl -i.bak -pe "s/session_is_registered('UserID')/isset(\$_SESSION['UserID'])/g" *.php

View 7 Replies View Related

Fedora :: What Is The Substitute Of Windows Movie Maker?

Apr 4, 2010

what is the substitute of windows movie maker in linux?

View 7 Replies View Related

Ubuntu :: Substitute For Internet Download Manager

Jan 29, 2010

I have gone through many threads but most of them have been dead for many time and I think there would have been a few advances in the Ubuntu software domain, so maybe a new downloader is up which manages downloads in a better way.Well, those who have used Internet Download Manager know that it is one of the best ones offered for Windows. It has many useful functions available in one single domain.

- It integrates to all browsers damn well, like charm.
- It can manage rapidshare, megaupload, hotfile and similar file hosting services very smoothly.
- It is a multi-threaded downloader which means that before starting to download file it breaks it up in many small pieces, and then downloads all fragments side by side, making the download very very fast, even on slower connections.
- It can also do very well with the websites which do not permit multithreaded downloading from their servers.
- It can take on video downloads from any page on the web which has a streaming video.
- It is very stable (if bought legitimately, which is not true in most cases ). But quite stable in even when not registered or cracked.
- Above all, it has a smart gui interface which provides interactive operations on downloaded files.

I have used many downloaders for Ubuntu and there has been some problem with each one. Some have a nice CLI structure but not GUI. Some of them are not multi-threaded. Some are multithreaded but do not allow pausing and continuing downloads (which actually does not satisfy the very definition of download managers). I haven't seen a single download manager which is GUI, multithreaded and well integrated to browsers all at the same time.What I want to know is, do my friends here at Ubuntu galaxy want to point out a real shiny star here which would make me forget the damn propriety software? Or if such a downloader hasn't been built yet, why not let's build one... Shouldn't be too hard especially if we have a model example (IDM 5.18 for Windows) in front of us... Well the algorithm must be simple, get address, verify the existence of file, break apart into several pieces and start downloading. I don't know how to implement this algorithm yet, but I am a quick learner and if a few expert programmers join me, we can do something that would remove one complain for most Ubuntu users.

View 4 Replies View Related

Ubuntu :: Software Substitute For The Microsoft Expressions?

Jan 14, 2011

Is there any software substitute for the Microsoft Expressions ? Recommendations ?

View 3 Replies View Related

Ubuntu :: Substitute For Inhibit-applet In Gnome3?

May 29, 2011

I've been fiddling with gnome3 quite a bit, several different variants, and something I've yet to find a solution for is a way to "inhibit" the screensaver and/or sleep features if watching a movie or such.In gnome2 I'd always just add 'inhibit-applet' to the panel, but I've so far found no substitute in gnome3.

View 1 Replies View Related

Applications :: Octave Good Substitute For Matlab?

Jan 12, 2010

Has anybody used both of these programs? How do they compare? Is Octave a good substitute for Matlab? How similar are the programing languages?

View 4 Replies View Related







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