Sponsored Content
Full Discussion: sed is dead
Top Forums Shell Programming and Scripting sed is dead Post 302525209 by origamisven on Thursday 26th of May 2011 04:54:16 AM
Old 05-26-2011
sed is dead

Hello everybody,
I'm new to bash scripting (and scripting in general) but I'm making decent progress in the hands-on solutions I need...
I've encountered a problem that seemed very simple to me at first, but had me going on for hours. Maybe you can help me.

Say I have an input text file like this...

test2:
SOL 0.031 7
SOL 0.032 8
SOL 0.033 8
SOL 0.034 8
SOL 0.035 9
SOL 0.036 9
SOL 0.037 9
SOL 0.038 10
SOL 0.040 10
SOL 0.041 11
SOL 0.042 11
SOL 0.043 11
I'm writing the coordinate of the second column into an array if the number in column 3 does not appear n times (thrice in my case) in the file.

if I echo out my array I get

0.031
0.038
0.040
I iterate through the array with a simple for loop like so...

Code:
for k in ${MOLARRAY[@]}
do
    sed -i -e '/"$k"/d' test2
done

I am trying to delete the lines that contain the values of my array in the text file test2 with sed. I've tried squeezing multiple ways of writing $k between the brackets but for some reason test2 is never edited.

any ideas?
 

9 More Discussions You Might Find Interesting

1. Solaris

Dead SUN

My SUN V210 refuses to fully boot up. We had a power outage (ie. someone tripped the cord) and thereafter the Sun will not come up, and the OS is not starting. The LED on the front is not lit. Monitor gets no feed, so I plugged in via the management port. The system comes up to: Trap 3e. and... (7 Replies)
Discussion started by: ireeneek
7 Replies

2. UNIX for Dummies Questions & Answers

dead.letter

HI, I am pretty new to Unix...but here is 1 serious problem...atleast for me..:-) now..the dead.letter file in /var/tmp has been growin continuously..n i dont know why..I ve even killed the sendmail process..but the dead.letter file keeps on increasin..Can anyone tell me where do I start... (6 Replies)
Discussion started by: unisam
6 Replies

3. UNIX for Dummies Questions & Answers

Jack Kilby dead at 81

If Edison and Ford were the the greatest inventors and influencers of the turn of the 20th century... then surely Jack Kilby was probably the most influential person of the late 21st century and for time immemorial...on our way of life. A legend dies (7 Replies)
Discussion started by: Kelam_Magnus
7 Replies

4. Filesystems, Disks and Memory

Dead partition on drive

We are still using solaris 1 with sunos 4.1.4 because nobody here knows Unix. My colleague did a backup (dump) to the wrong place (/dev/sd0h) and we lost this part of the drive. The information is still on tape but we cannot repartition the /dev/sd0h. fsck keeps on about the "wrong SUPER BLOCK"... (2 Replies)
Discussion started by: Tom Bekaert
2 Replies

5. Shell Programming and Scripting

what is dead.letter ??

Hi all can you please help me what is dead.letter file ? when it is created ? for the first time i have seen this file getting created in my current directory? I am using SunOs. Any IDEA ?? (2 Replies)
Discussion started by: jambesh
2 Replies

6. Filesystems, Disks and Memory

Dead SCSI drive

I have 2 dead SCSI drives. Can anyone tell me a good way to repair the disks??? Please! (1 Reply)
Discussion started by: disturbe_d
1 Replies

7. What is on Your Mind?

Usenet is dead

On servers i check there seems to be no news at all. (3 Replies)
Discussion started by: Action
3 Replies

8. Post Here to Contact Site Administrators and Moderators

Dead link in FAQ

Dead link from FAQ, then Technical FAQ: Senior Advisor - https://www.unix.com (Was about to suggest that a O/P read this FAQ). (9 Replies)
Discussion started by: methyl
9 Replies

9. Shell Programming and Scripting

showing dead accounts?

Got a quick question. How do you shows dead accounts (false shells) and how do you include a count at the end? (1 Reply)
Discussion started by: JA50
1 Replies
SOL(6)								   Games Manual 							    SOL(6)

NAME
AisleRiot - a collection of card games which are easy to play with the aid of a mouse. SYNOPSIS
sol [options] DESCRIPTION
This manual page documents briefly the sol command. For more information, please refer to the excellent GNOME help for AisleRiot AisleRiot (also known as Solitaire or sol) is a collection of card games which are easy to play with the aid of a mouse. The rules for the games have been coded for your pleasure in the GNOME scripting language (Scheme). It is part of the gnome-games package. The following games can be selected from within the program, or by using a command line switch: Peek, Auld Lang Syne, Fortunes, Seahaven, King Albert, First Law, Straight Up, Jumbo, Accordion, Ten Across, Plait, Lady Jane, Gypsy, Neighbor, Jamestown, Osmosis, Kings Audience, Glenwood, Gay Gordons, Monte Carlo, Kansas, Camelot, Fourteen, Scorpion, Isabel, Escalator, Agnes, Bristol, Quatorze, Bear River, Gold Mine, Athena, Spiderette, Chessboard, Backbone, Yukon, Union Square, Eight Off, Napoleons Tomb, Forty Thieves, Streets And Alleys, Maze, Clock, Pileon, Canfield, Thirteen, Bakers Game, Triple Peaks, Easthaven, Terrace, Aunt Mary, Carpet, Sir Tommy, Diamond Mine, Yield, Labyrinth, Thieves, Saratoga, Cruel, Block Ten, Will O The Wisp, Odessa, Eagle Wing, Treize, Zebra, Cover, Elevator, Fortress, Giant, Spider, Gaps, Bakers Dozen, Whitehead, Freecell, Hel- sinki, Spider Three Decks, Scuffle, Poker, Klondike Three Decks, Valentine, Royal East, Thumb And Pouch, Klondike, Doublets, Tem- plate, Golf, Westhaven, Beleaguered Castle, Hopscotch OPTIONS
AisleRiot accepts the following options, besides the usual Gtk+/GNOME switches: -v, --variation=NAME Select the game to play --display=DISPLAY X display to use USAGE
This text is taken verbatim from the AisleRiot Manual V2.12. Moving the cards is reasonably obvious. Assuming you have a right-handed mouse, left-click on a card and drag it somewhere. Release the mouse button to deposit the card. If a card can be moved to the foundation(s), you do not need to drag it. You can double-click on it and it will move. If a sequence of cards can be moved to the foundations, you can generally move the sequence as one move. Double clicking a card will send it to a foundation, if that is possible. This is useful for cleaning up large numbers of cards at the end of a successful game. In games which have a stock pile you can redeal it by clicking on the empty space where it was. Be warned that some games only let you do this a limited number of time. Watch for the Redeals Left message at the bottom of the window. A useful tip to know is that right-clicking on a face-up card which is partially obscured by a card laid over it will raise it so that you can see what it is. There is an alternative way to move cards. By selecting Click to move from the Control menu you can click once to pick up a card and then click again to place it. This can be faster than dragging and will be easier on your hand since you don't have to hold the mouse down. However, it may take a while to get used to. Some games have options to change the way the game is played. For example Klondike can be played with either single card deals or three- card deals. In these games there is a separate menu with the game's name. You can only change the rules of the game at the beginning of the game -- the menu will be inactive during the game. Statistics on how well you have done at a particular game are available by selecting Statistics from the Game menu. Only games where you actually start moving cards are counted. The statistics are here for your own enjoyment, there are numerous ways to cheat and it is unwise to make comparisons. HOMEPAGE
http://www.gnome.org/projects/gnome-games/ AUTHOR
This manual page was written by Martin Ferrari <martin.ferrari@gmail.com>, for the Debian system (but may be used by others). You can find the list of authors and more information about AisleRiot in /usr/share/doc/gnome-games. AisleRiot March 22, 2007 SOL(6)
All times are GMT -4. The time now is 09:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy