Software :: Extra Newline At End Of File?
Apr 11, 2009
I've noticed when I create a generic textfile in vim and have a trailing newline at the end of the file, when I open it with kate it has 2 new lines at the end of the file instead! This is on a fedora machine. The same behavior is observed when I copy the file over to my windows machine and open it in notepad++ (which is able to handle both unix and dos newlines) - 2 newlines instead of 1.
Feeling curious, I tried creating a textfile in vim on my ubuntu machine and used gedit to open it, but surprisingly gedit displayed it correctly - only 1 newline.
View 7 Replies
ADVERTISEMENT
Nov 22, 2010
I have several (vhdl) files containing a pattern with newline characters that I need to replace by another pattern that also contains newline characters.
I start with something like:
Code:
I want to replace it by something like:
Code:
(I need to paste some lines)
As I need to do this (very) often I want to use a shell script.
I tried:
1.
Code:
result:
Code:
2.
Code:
result:
File remains unchanged
3.
Code:
result:
Code:
4.
Code:
result:
Displays the unchanged testfile
How I can automate the pattern replacement?
Code:
View 9 Replies
View Related
Nov 11, 2009
I'm having a hard time figuring out why the program posted below prints an extra newline every time I type the enter key.This program is using the master pseudo-terminal to send the password and receive the output from the slave(connected to the passwd program).I suspect this has to do with the terminal line discipline(s)(2 considering the master and slave), but I can't really understand why.I have tried turning on/off several terminal special characters but to no avail.
Source code follows(compiled in x86, Slackware-13.0 - linux-2.6.31.5 - gcc 4.3.3):
Code:
View 14 Replies
View Related
Feb 23, 2010
I have recently taken delivery of a Dell Inspiron mini netbook with Ubuntu on, and I am new-fangled .install updates, I clicked the (orange down-arrow) button, and it compalined "E: /var/cache/apt/archives/linux-image-2.6.24-22-lpia_2.6.24-22.45netbook9_lpia.deb: files list file for package `libxcb-shape0' is missing final newline"
View 2 Replies
View Related
Jul 18, 2010
there are 2 related to 11.3: openSUSE_11.3/ and openSUSE_11.3_KDE_Distro_Factory/ Index of /repositories/KDE:/Extra they are not listed as official kde4 repos here KDE repositories - openSUSE, but they are in the same directory structure on the build service so it would assume they are official (what ever official means) They have rpm's I didn't see in community and playground (at least for 11.3) such as audex and clementine I would guess that they are for the stable and factory versions of KDE4 but then shouldn't there be a 3rd for unstable if this was the case? Or do they refer to the distro, 11.3 stable and 11.3 factory
View 6 Replies
View Related
Mar 6, 2009
I have two files containing list of packages using
Code:
dpkg --get-selections > file-name
command.
package-a.txt
[code]......
Now I would like to create a third file which contains only those packages which are present in package-a.txt but NOT in package-b.txt. The file should look like this:
Code:
package2
package4
Note: The world "install" is also to be removed for all packages. Using diff command I could get something like this:
Code:
temp# diff -yb package-a.txt package-b.txt | grep "<"
package2 install <
package4 install <
<
temp#
But not sure how to remove instances of "install" and "<".
View 3 Replies
View Related
Aug 11, 2011
I am working with bash scripting and running into a weird issue where the trailing newline characters are being truncated.The file contents are something like:
Code:
# Catting the file shows the trailing
characters
cat /tmp/junk
first line
second line
[Code]...
Since I am working with config files, some of the applications/daemons fail to start if they fail to find trailing newline characters
View 4 Replies
View Related
Nov 28, 2009
I'm writing a script to replace some text that exists in about 50 .lex, .y, and .cc source code files, sometimes more than once in a file. Sometimes the text is in a multiline C comment, and other times it's within a multiline C string.
I use sed to grab the start and end of each line and wrap the new text in the old whitespace and/or quotes and Problem is, sed is changing the characters into a newline.
Is there a way to tell sed to not process escape sequences? I tried using several variations of
Code:
To no avail. Or could it be bash?
I would give up on the script and do it by hand, but this is something that I must do from time to time.
Here's the function which replaces the first occurrence found:
Code:
When $post is printed by echo, it shows the - but by the time the file is on disk, it becomes a newline. What should I do to ensure that it stays as the characters ?
View 4 Replies
View Related
Mar 11, 2011
I have a tab delimited file. I need to replace the 7th tab with a new line.
I tried the following command (but it does not work):
The above simply spits out the original file.
If I write the next command, it replaces the first tab in each line with a newline. How can I make it replace the 7th tab in each line?
View 4 Replies
View Related
May 1, 2010
I want to create an alias or function that when used prints something like this on the command line so I can further modify it before pressing enter myself.
Code:
$ FILE=exercise1; cc -o $FILE $FILE.c && ./$FILE; FILE=
The idea is that I'm studying c and want to change the name of the file once instead of
[code]....
View 3 Replies
View Related
Dec 2, 2009
I've been playing around with sed but can't find a way to remove the <br> html tag and replace it with a newline. Sed isn't truly needed awk or other suggestions could be good.
View 3 Replies
View Related
Dec 23, 2010
Concatenating two files without creating a newline between them? So how is it possible to do that? I've tried the following:
Code:
echo 123 > file1
echo 456 > file2
cat file2 file2 > file3
[Code]....
View 8 Replies
View Related
Mar 8, 2009
I need to replace part of a line in a file with multiple lines, however need to separate each line with a newline is this possible?
Example, need to remove line 2
And insert line similar to below:
If the multiple lines were part of a text file, would inserting a text file automatically include newline characters?
View 1 Replies
View Related
Mar 11, 2011
I have bash script which has lots of echo statements and also I aliased echo to echo -e both in .bash_profile and .bashrc, so that new lines are printed properly for a statement like echo 'Hello World' the output should be I even tried using shopt -s expand_aliases in the script, I am running my script as bash /scripts/scriptnm.sh; if I run it as . /scripts/scriptnm.sh I am getting the desired output.
View 4 Replies
View Related
Jul 21, 2011
I'm new to php.
I wrote a basic php script using gedit:
Saved is as FirstPHP.php
Then I did a chmod 755 FirstPHP.php
And ran it. Got the following out put:
Why am I getting a syntax error? Am I missing something?
View 2 Replies
View Related
Apr 27, 2010
I can't get x to work with a mouse so I have to use a windows computer to do that from for now. The problem is I remember there being something about windows using a newline AND carriage return and linux just using a newline. I was about to cut and paste code but the lines go on and on instead of breaking off where they did in linux. I was going to write a perl script but don't know how to add a carriage return to the end of each line.
View 3 Replies
View Related
May 21, 2011
Using xsel I pass a selection into a variable. I then check that the variable includes an embedded newline to be sure that the selection returned by xsel is complete. If the selection content preceding the newline is just a single word, the check fails to detect the newline, thus
Code:
g fnm=`xsel`
g cat <<< "$fnm"
Whatis
apropos sear
[code]....
View 14 Replies
View Related
Jan 9, 2010
I have a dell mini 10v with ubuntu. I have been trying reapteadly to try to get the ubutnu version of mana world on my laptop but it always says its missing a newline. Because i download the game from my synapic manager and it says its missing final newline.
View 8 Replies
View Related
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
Mar 16, 2011
I got install_ubuntulite_nouveau: line1: syntax error near unexpected token 'newline'
when running sudo bash install_ubuntulite_nouveau
View 1 Replies
View Related
Jun 11, 2010
Why do I get an error when trying to do a simple install command?I'm trying to install VMware player 3.1.0 on Ubuntu 9.10 After logging in to the terminal and changing directory to the folder containing the VM player bundle file, I used the following command:
sudo sh VMware-Player-3.1.0-261024.i386.bundle
It then prompts me for the password:
[sudo] password for administrator:
After entering the password it then returns the error:
VMware-Player-3.1.0-261024.i386.bundle: 110: Syntax error: newline unexpected
administrator@ubuntu:~/Documents/gnb1$
View 9 Replies
View Related
Mar 11, 2010
When I am adding removing packages to get more hard drive space, this is not the first time I left too many pages open and it crashes on me. My son would fix it by typing in the terminal sudo something, but I want to know how to do this. The only thing not working is the add/remove packages at the moment. Here is what it said, E:dpkg was interrupted you must manually run 'dpkg--configure -a' to correct the problem E: _cache-open()failed please report. Please, could someone tell me how to get the default back or whatever. When I type in the terminal, it refused my password until I tried several times, plus, it finally says in the terminal No such command. Bash. No such command. I am hoping this question is one you do recognize the answer for.
I tried using Yum to remove the package. Like this:
To remove or uninstall a package:
Code:
yum -y remove ,package name>
Terminal goes: Bash syntax error near unexpected token `newline'
View 3 Replies
View Related
Jan 13, 2010
I'm trying to create a new directory using the mkdir command.
Code:
home@ubuntu:~$ mkdir <aicoursework>
bash: syntax error near unexpected token `newline'
that's the error that i keep getting, what am i doing wrong?
View 5 Replies
View Related
Jul 24, 2010
I would like to know whether I can add this as a repository[URL].. to my fedora 13 installation, in order to have hardware accelerated video playback and follow future updates. I'm new to fedora so not very familiar with yum,
View 2 Replies
View Related
Mar 24, 2010
Does anyone know how to set openSUSE up to use additional XDG icons? I downloaded a pack of icons from here that I'd quite like to use, but they're not showing up at the moment. I'm assuming that they're already named with the correct convention and I've put them in the right folder (.icons/TangoExtra/scalable/places - and the theme is being used) but I don't know if they're getting ignored because openSUSE isn't set to check those conventions.
View 9 Replies
View Related
Nov 18, 2009
I installed F12 KDE from the live cd and now when I Shutdown or Reboot, it takes 2 minutes and 8 seconds for the machine to power off. Yes, I timed it. Happens everytime like that. Even when booting from both "mainstream" live cd and the KDE spin live cd. When I hit the Shutdown or Reboot, it goes through the daemons/services shutdown the flashes up the Halting System or Please wait while the system reboots messages (respectivley), turns off the LCD and then just... sits with the power light on and hard drive activity light on. I should mention this is on a Toshiba Laptop about a year old. Intel Chipsets. (Satellite Pro S300M-S2142 if anyone is really curious).
The hard drive light stays on for about 1:03 minutes and then it turns off, at 2:08 minutes - the Power light finally turns off and the thing finally shuts down. I've tried adding acpi=off, but that just gets me a kernel panic on startup and acpi=debug all I seem to notice is "Malformed early option 'acpi'" in messages and dmesg. How consistant the power off time is makes me think there's a timeout of sorts going on, but I have no idea on how to track that down.
View 2 Replies
View Related
Sep 4, 2011
I need to do something very simple, I have two small buttons on the side of the mouse, I want one of them to do go to upper workspace (like CTRL ALT UP) and the other one go to lower workspace (CTRL ALT DOWN).I used to do this using compiz but now with Gnome3?
View 2 Replies
View Related
Mar 1, 2010
I updated my system and then this popped up:
I picked the option that is selected, then I restarted pc to apply updates and now my "grub" menu has 2 extra options.
The first 2 are the new ones.
I don't know what its for.. but when I start up the computer I pick the Ubuntu, Linux 2.6.31-19-generic
View 2 Replies
View Related
Apr 7, 2010
For anyone using Chromium [version 5.0.370.0 (43799) Ubuntu] from the daily PPA, are you seeing extra-space above the tabs?
View 8 Replies
View Related
Jul 12, 2010
I followed the following instructions [URL] to get my custom text to appear. The result was many GLTexts in my screensaver properties.
Does anyone know what I need to edit to get rid of all the extra entries?
View 2 Replies
View Related