Sponsored Content
Top Forums Shell Programming and Scripting while read loop preserving leading whitespace Post 51979 by zazzybob on Monday 7th of June 2004 11:58:21 AM
Old 06-07-2004
Many thanks Ygor, I thought it'd be something fairly simple!

Cheers
ZB
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh - read file with leading spaces

Hi, Could someone has any suggestions on this? When read a line from a file, I need to check the first char in the line, it could be a space or any char. But the leading spaces are removed by read. Thanks. (2 Replies)
Discussion started by: momi
2 Replies

2. Shell Programming and Scripting

Preserving whitespace in a for loop

I obviously haven't learned my lesson with shell and whitespace. find /path/to/some/where/ -name "*.pdf" | awk '{print $5}'| uniq -d results: some Corporation other Corporate junk firmx Works fine from cmdline but the whitespace turns into another FS in a for loop. for... (7 Replies)
Discussion started by: s_becker
7 Replies

3. Shell Programming and Scripting

Whitespace in filenames in for loop in bash script

I'm trying to search all .odt files in a directory for a string in the text of the file. I've found a bash script that works, except that it can't handle whitespace in the filenames. #!/bin/bash if ; then echo "Usage: searchodt searchterm" exit 1 fi for file in $(ls *.odt); do ... (4 Replies)
Discussion started by: triplemaya
4 Replies

4. Shell Programming and Scripting

Preventing whitespace to be a delimiter in a for loop (bash/sh)

Hi, I have a for loop which iterates over a list of strings, separated by whitespace: $ list="1 2 3" $ for i in $list; do echo $i; done 1 2 3 I now want to introduce some strings containing whitespace themselves ... This is straightforward if I directly iterate over the list: $ for... (4 Replies)
Discussion started by: kkkoehne
4 Replies

5. Shell Programming and Scripting

How to match (whitespace digits whitespace) sequence?

Hi Following is an example line. echo "192.22.22.22 \"33dffwef\" 200 300 dsdsd" | sed "s:\(\ *\ \):\1:" I want it's output to be 200 However this is not the case. Can you tell me how to do it? I don't want to use AWK for this. Secondly, how can i fetch just 300? Should I use "\2"... (3 Replies)
Discussion started by: shahanali
3 Replies

6. Shell Programming and Scripting

Preserving values with for loop for later use

Below is the issue I am having. I have a few variables which have certain values in them like var1=23 var2=46 var3=78 etc... I want to save these values with the help of a for loop in a single variable so that I can use it later,beacuse a few lines down the script, some of these... (3 Replies)
Discussion started by: Elizabeth H
3 Replies

7. UNIX for Dummies Questions & Answers

[Solved] How remove leading whitespace from xml (sed /awk?)

Hi again I have an xml file and want to remove the leading white space as it causes me issues later in my script I see sed is possible but cant seem to get it to work I tried sed 's/^ *//' file.xml output <xn:VsDataContainer id="1U104799" modifier="update"> ... (10 Replies)
Discussion started by: aniquebmx
10 Replies

8. Shell Programming and Scripting

Read line, issue with leading - and {}'s

Heyas With my forum search term 'issue with leading dash' i found 2 closed threads which sadly didnt help me. Also me was to eager to add the script, that i didnt properly test, and just now figured this issue. So i have this code: if ] then while read line do line="${line/-/'\-'}"... (7 Replies)
Discussion started by: sea
7 Replies

9. Shell Programming and Scripting

[BASH] read 'line' issue with leading tabs and virtual line breaks

Heyas I'm trying to read/display a file its content and put borders around it (tui-cat / tui-cat -t(ypwriter). The typewriter-part is a 'bonus' but still has its own flaws, but thats for later. So in some way, i'm trying to rewrite cat using bash and other commands. But sadly it fails on... (2 Replies)
Discussion started by: sea
2 Replies

10. Shell Programming and Scripting

REGEX to separate paths by whitespace and do a loop

I am trying to do in a single line to take a list of paths separated by whitespace and then loop thru all the paths that were wrote but my regex is not working, I have echo {3} | sed 's/ //g' | while read EACHFILE do ..... But for some reason is only taking always the first path that I... (7 Replies)
Discussion started by: jorgejac
7 Replies
planets(1)						      General Commands Manual							planets(1)

NAME
planets - Gravitational simulation of planetary bodies DESCRIPTION
Planets is a simple interactive program for playing with simulations of planetary systems. It is great teaching tool for understanding how gravitation works on a planetary level. The user interface is aimed at being simple enough for a fairly young kid can get some joy of it. There's also a special kid-mode aimed at very young children which grabs the focus and converts key banging into lots of random planets. KEYBINDINGS
Universe definition a Add Planet j Place random orbital planet r Place random planet u Undo (undoes last planet insertion) e Reset to empty universe g Go Back (goes back to just after last planet insertion) Mouse Click on a planet to delete it Physics b Toggle bounce (experimental) Display control Cursor keys Panning c, Space Move display to center of mass x Initiate center of mass tracking = Zoom in - Zoom out p Toggle Pause o Change all colors randomly t Toggle Trace d Double Trace Length h Halve Trace Length Mouse Drag a box around a set of planets to follow the center of mass of those planets Program control H Display help dialog k Display option dialog Ctrl-Shift-k Toggle kid-mode. Kid mode locks the keyboard and mouse, so the only way to get out is to toggle kid-mode again to get out. l Load Universe After pressing l, press any other character to load the universe with that name. Universes are stored in ~/.planets/ . s Save Universe After pressing s, press any other character to save the universe with that name. Universes are saved in ~/.planets/ . q, Esc Quit TECHNICAL DETAILS
Planets uses a fourth-order runge-kutta approximation for the simulation itself. Planet bouncing is achieved by adding a repulsive force to planets at close quarters. Planets is fairly flexible: you can change the gravitational constant, the time-slice of the simulation, and even the exponent used in the gravitational law. Universes are saved in the ~/.planets directory, and are simple human readable and editable files. BUGS
Currently bouncing doesn't work very well unless you make the time-slice quite small. Ideally, it would be nice to have a billiard-style bounce system, but it's not clear how to do this accurately in the presence of a strong gravitational field. AUTHOR
Planets was written by Yaron M. Minsky <yminsky@cs.cornell.edu> as a gift for his nephew, Eyal Minsky-Fenick. This manpage was contributed originally by Martin Pitt <martin@piware.de> for the Debian GNU/Linux system (but may be used by others). April 20, 2003 planets(1)
All times are GMT -4. The time now is 04:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy