Sponsored Content
Full Discussion: Remove blank line - SED
Top Forums Shell Programming and Scripting Remove blank line - SED Post 302228305 by pcwiz on Saturday 23rd of August 2008 09:05:15 PM
Old 08-23-2008
Remove blank line - SED

HI, I have this list of apps like so:

Code:
DivX Products.app
DivX Support.app
Uninstall DivX for Mac.app
Build Applet.app
SpringBoard.app
Interface.app
MobileAddressBook.app
MobileSafari.app
MobileSlideShow.app
Preferences.app
Install Flash Player 8 OSX.app
Yap.app
check_afp.app

chess.app

There's that one blank line between "check_afp.app" and "chess.app". How do I remove that blank line? I've already tried "sed '/^$/d'" but it didn't work.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed: delete regex line and next line if blank

Hi, I want to write a sed script which from batiato: batiato/giubbe: pip_b.2.txt pip_b.3.txt pip_b.3mmm.txt bennato: bennato/peterpan: 123.txt consoli: pip_a.12.txt daniele: (2 Replies)
Discussion started by: one71
2 Replies

2. Shell Programming and Scripting

sed: print out to first blank line

I am trying to use wget and sed to extract a text based weather forecast for the Greater Victoria area only, this is one paragraph of many in a web page. I have tried /^$/ but that does not seem to work. So far I get mostly what I want with this: wget -qO -... (2 Replies)
Discussion started by: lagagnon
2 Replies

3. Shell Programming and Scripting

Remove last blank line of file

I have a number of files (arranged in directories) which have last line blank, I am trying to synchronize my code with other env and due to this blank lines, all files error out as different although only difference is that of balnk line at end of file. Is there a way I can recursively... (2 Replies)
Discussion started by: ruchimca
2 Replies

4. UNIX for Dummies Questions & Answers

Question: Help need to remove blank line & sed: Couldn't re-allocate memory error.

I've shell script where i used the below command to take the line which contains patterns. sed -n "/$year 05:/,/$year 17:/p" trace.log | grep -f patterns.txt > output.log This was working fine for long time, but now a days this script is not working with and throwing error like sed:... (8 Replies)
Discussion started by: senthil.ak
8 Replies

5. Shell Programming and Scripting

sed adding a blank line

I use the following as part of a script to correct for a faulty hostname file. # get the domain name read -r thehostname < /etc/hostname dom="$(echo $thehostname | cut -d'.' -f2)" numchar=${#dom} if then echo "It appears as though the hostname is not correctly set." echo "Hostname has... (5 Replies)
Discussion started by: bugeye
5 Replies

6. Shell Programming and Scripting

Delete lines containing and remove the blank line at the same time

Is there a way to delete a line containing something and the blank line at the same time? If you do this it leaves a blank line behind. sed '/yum/d' .bash_historyI know this works but I would think there would be a way to do it with one command sed '/yum/d' .bash_history | sed '/^$/d'In... (2 Replies)
Discussion started by: cokedude
2 Replies

7. Shell Programming and Scripting

How to remove blank line from a text file?

Hi All, I am creating a text file using perl. The first record I am writing as "$line" and all the other as "\n$line". At the end the file is having N number of lines. I am using this file for MLOAD (Teradata), which is reading N+1 lines in the file and failing.I am not able to find new line... (2 Replies)
Discussion started by: unankix
2 Replies

8. Shell Programming and Scripting

Remove Space and blank line from file in UNIX shell script

I have below file. I want to remove space at begining of every line and then after also remove blank line from file. I use below code for each operation. sed -e 's/^*//' < check.txt > check1.txt sed '/^\s*$/d' < check1.txt > check2.txt above code not remove all the space... (12 Replies)
Discussion started by: Mohin Jain
12 Replies

9. Shell Programming and Scripting

sed - How to insert line before the first blank line following a token

Hello. I have a config file (/etc/my_config_file) which may content : # # port for HTTP (descriptions, SOAP, media transfer) traffic port=8200 # network interfaces to serve, comma delimited network_interface=eth0 # set this to the directory you want scanned. # * if have multiple... (6 Replies)
Discussion started by: jcdole
6 Replies

10. Shell Programming and Scripting

Bash - sed - Remove first word from line which can begin eventually with blank

hello. How to remove first word from line. The line may or may not start with blank. NEW_PARAM1=$(magic-command " -t --protocol=TCP -P 12345-u root -h localhost ") NEW_PARAM2=$(magic-command "-t --protocol=TCP -P 12345 -u root -h localhost ") I want NEW_PARAM1 equal to NEW_PARAM2 equal ... (2 Replies)
Discussion started by: jcdole
2 Replies
Plack::App::Cascade(3pm)				User Contributed Perl Documentation				  Plack::App::Cascade(3pm)

NAME
Plack::App::Cascade - Cascadable compound application SYNOPSIS
use Plack::App::Cascade; use Plack::App::URLMap; use Plack::App::File; # Serve static files from multiple search paths my $cascade = Plack::App::Cascade->new; $cascade->add( Plack::App::File->new(root => "/www/example.com/foo")->to_app ); $cascade->add( Plack::App::File->new(root => "/www/example.com/bar")->to_app ); my $app = Plack::App::URLMap->new; $app->map("/static", $cascade); $app->to_app; DESCRIPTION
Plack::App::Cascade is a Plack middleware component that compounds several apps and tries them to return the first response that is not 404. METHODS
new $app = Plack::App::Cascade->new(apps => [ $app1, $app2 ]); Creates a new Cascade application. add $app->add($app1); $app->add($app2, $app3); Appends a new application to the list of apps to try. You can pass the multiple apps to the one "add" call. catch $app->catch([ 403, 404 ]); Sets which error codes to catch and process onwards. Defaults to 404. AUTHOR
Tatsuhiko Miyagawa SEE ALSO
Plack::App::URLMap Rack::Cascade perl v5.14.2 2011-12-04 Plack::App::Cascade(3pm)
All times are GMT -4. The time now is 03:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy