Sponsored Content
Operating Systems OS X (Apple) A fixed point basic calculator for DASH. Post 303025624 by wisecracker on Wednesday 7th of November 2018 05:23:08 PM
Old 11-07-2018
Hi Corona688...

Quote:
Anyway, you can use a here-document to feed values into read.
Code:
#!/usr/local/bin/dash
# heredoc.sh
IFS="$IFS"'.'

read -r INT FLOAT <<EOF
$1
EOF
echo "$INT $FLOAT"

WOW! I didn't find anything about this on the mighty WWW. This earns you a big thank you and certainly does open up new avenues...
Results on my usual gear:
Code:
Last login: Wed Nov  7 19:10:03 on console
AMIGA:amiga~> cd Desktop/Code/Shell
AMIGA:amiga~/Desktop/Code/Shell> chmod 755 heredoc.sh
AMIGA:amiga~/Desktop/Code/Shell> ./heredoc.sh 123.456
123 456
AMIGA:amiga~/Desktop/Code/Shell> _

Quote:
There's another, older trick though, which works especially well in functions and should work anywhere.
Now this I would be interested in, please post an example ASAP.
I will re-do my code accordingly and check against Python. Gimme a bit of time.

This is why I am an amateur and you are a professional, my knowledge is far less than yours and others in this sphere.

<thumb-up-smilie-here>
EDIT:
Done my own. ;o)
Code:
	        .--.
	        \   \
	         .   .
	         |   |
	         |   |
	         |   |
	    ____/     `-----------.
	   /                       )
	  |           +----------.'
	  |                       )
	  |           +---------.'
	  |                      )
	  |           +--------.'
	   \                    )
	    '------------------'

Bazza...

Last edited by wisecracker; 11-07-2018 at 06:56 PM.. Reason: Add my own text mode thumbs up...
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Fibre connection Point to Point SUN

Anyone know of a guide or instructions for Solaris I got to configure a SBUS HBA to talk to a tape robot. I have done this on a switch but not point to point. just going HBA >>>>> TAPE Fibre simple two nodes Kie (6 Replies)
Discussion started by: kie
6 Replies

2. UNIX for Dummies Questions & Answers

dash after ampersant

Hi! I'm new in these forums and more or less new with Unix. So... here is the question: does anyone know where is redirected the output of a command when you put >&- after it? Does it means any standard file descriptor? Thanks! (2 Replies)
Discussion started by: csecnarf
2 Replies

3. Shell Programming and Scripting

How to perform a hexdump using dd from start point to end point?

hi, I would like to ask or is it possible to dump a hex using dd from starting point to end point just like the "xxd -s 512 -l 512 <bin file>" I know the redirect hexdump -C but i can't figure it out the combination options of dd. Hope someone can share their knowledge.. Thanks in... (3 Replies)
Discussion started by: jao_madn
3 Replies

4. Post Here to Contact Site Administrators and Moderators

How to sum up data in fixed width file with decimal point?

HI Everyone, I have below source file AAA|NAME1|ADDRESS1|300.20 BBB|NAME2|ADDRESS2|400.31 CCC|NAME3|ADDRESS3|300.34 I have requirement where I need to sum up fourth field in above fixed width pipe delimited flat file. When I use below code, it gives me value 1001.00 But I am expecting... (1 Reply)
Discussion started by: patricjemmy6
1 Replies

5. Shell Programming and Scripting

Fixed mount point for a USB cardreader (Raspberry Pi, UDEV)

Hey all! :) I'm trying to create a fixed mount point for an usb cardreader. I've found a script on a raspberry pi forum which does the following: usb stick is plugged in -> script checks the mount point for data -> script starts copying the files automatically -> script unmounts the... (0 Replies)
Discussion started by: Eomer
0 Replies

6. UNIX for Beginners Questions & Answers

How to create a new mount point with 600GB and add 350 GBexisting mount point? IN AIX

How to create a new mount point with 600GB and add 350 GBexisting mount point Best if there step that i can follow or execute before i mount or add diskspace IN AIX Thanks (2 Replies)
Discussion started by: Thilagarajan
2 Replies

7. Shell Programming and Scripting

A dash to GOTO or a dash from GOTO, that is the question...

Well, guys I saw a question about GOTO for Python. So this gave me the inspiration to attempt a GOTO function for 'dash', (bash and ksh too). Machine: MBP OSX 10.14.3, default bash terminal, calling '#!/usr/local/bin/dash'... This is purely a fun project to see if it is possible in PURE... (3 Replies)
Discussion started by: wisecracker
3 Replies
page_util_quote(3tcl)					      Parser generator tools					     page_util_quote(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
page_util_quote - page character quoting utilities SYNOPSIS
package require page::util::quote ?0.1? package require snit ::page::util::quote::unquote char ::page::util::quote::quote'tcl char ::page::util::quote::quote'tclstr char ::page::util::quote::quote'tclcom char _________________________________________________________________ DESCRIPTION
This package provides a few utility commands to convert characters into various forms. API
::page::util::quote::unquote char A character, as stored in an abstract syntax tree by a PEG processor (See the packages grammar::peg::interpreter, grammar::me, and their relations), i.e. in some quoted form, is converted into the equivalent Tcl character. The character is returned as the result of the command. ::page::util::quote::quote'tcl char This command takes a Tcl character (internal representation) and converts it into a string which is accepted by the Tcl parser, will regenerate the character in question and is 7bit ASCII. The string is returned as the result of this command. ::page::util::quote::quote'tclstr char This command takes a Tcl character (internal representation) and converts it into a string which is accepted by the Tcl parser and will generate a human readable representation of the character in question. The string is returned as the result of this command. The string does not use any unprintable characters. It may use backslash-quoting. High UTF characters are quoted to avoid problems with the still prevalent ascii terminals. It is assumed that the string will be used in a double-quoted environment. ::page::util::quote::quote'tclcom char This command takes a Tcl character (internal representation) and converts it into a string which is accepted by the Tcl parser when used within a Tcl comment. The string is returned as the result of this command. BUGS, IDEAS, FEEDBACK This document, will undoubtedly contain bugs and other problems. Please report such in the category page of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have. KEYWORDS
page, parser generator, quoting, text processing CATEGORY
Page Parser Generator COPYRIGHT
Copyright (c) 2007 Andreas Kupries <andreas_kupries@users.sourceforge.net> page 1.0 page_util_quote(3tcl)
All times are GMT -4. The time now is 11:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy