Search Results

Search: Posts Made By: wisecracker
72,511
Posted By wisecracker
A workaround POSIX shell compliant. #!/bin/sh ...
A workaround POSIX shell compliant.
#!/bin/sh

# #!/usr/local/bin/dash
# newline.sh

printf "\nA test.\n\n" > /tmp/nl

for subscript in 0 1 2 3 4 5 6 7 8 9
do
nl=$( hexdump -n1...
72,511
Posted By wisecracker
Not sure if this is what you re after but fully...
Not sure if this is what you re after but fully POSIX compliant:-
Longhand OSX 10.14.3, default bash terminal calling dash.
Last login: Wed Apr 29 21:46:11 on ttys000
AMIGA:amiga~> dash...
Forum: OS X (Apple) 04-25-2020
47,707
Posted By wisecracker
Fun project calculating PI using integer maths.
Hi all...

As you know I have garnered a great interest in using integer maths to do some fixed point calculations.
Here is my next incarnation, calculating PI to 3 and 12 decimal places using 2...
12,871
Posted By wisecracker
Hi MadeInGermany... The problem is it rounds...
Hi MadeInGermany...
The problem is it rounds both down and up; and int() function rounds down only...
Last login: Wed Apr 22 17:51:50 on ttys000
AMIGA:amiga~>
AMIGA:amiga~> dash
AMIGA:\u\w> ...
13,213
Posted By wisecracker
In POSIX try: printf "\035"
In POSIX try:
printf "\035"
6,414
Posted By wisecracker
Hi Nosi... As far as I know there is only one...
Hi Nosi...
As far as I know there is only one platform that has the ask utility and that is the ancient AMIGA family of computers.
I assume you mean 'awk' so have you searched this site for...
22,729
Posted By wisecracker
Attached to previous and don't know why.
Last login: Sun Apr 12 14:58:50 on ttys000
AMIGA:amiga~> read STRING <<"EOT"
> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
> EOT
AMIGA:amiga~> ...
22,729
Posted By wisecracker
Hi RudiC... I already know about conjoining...
Hi RudiC...

I already know about conjoining strings and this is the way 'set' does it from the working part of the code:
STRING='...
22,729
Posted By wisecracker
Without the aid of the escape mechanism, how to put a raw string into a variable?
Hi guys and gals...
I have been racking my brains with this one and I can't find anything about it...
Consider the code and the results below:
#!/usr/local/bin/dash

# #!/bin/sh
# #!/bin/bash...
Forum: What is on Your Mind? 03-24-2020
15,505
Posted By wisecracker
Hi Neo... Will we still need our old user...
Hi Neo...

Will we still need our old user and password for this site, because if it is read only then they are not really required.


Barry...
Forum: OS X (Apple) 03-12-2020
9,927
Posted By wisecracker
A very basic Haar Discrete Wavelet Transform for Python 1.4.0 to 3.8.0...
Hi guys and gals...
(Apologies for any typos, etc...)

Another code snippet mainly for the AMIGA but works from Python 1.4.0 to 3.8.0 on just about any platform, hence the first upload here. I...
7,158
Posted By wisecracker
The usual questions: Which OS are you...
The usual questions:


Which OS are you using?
What are your preferred tools/utilities/shells/languages?


And most of all what have you tried?
Forum: Programming 03-08-2020
15,897
Posted By wisecracker
If you are using one line it HAS to be: ...
If you are using one line it HAS to be:
MYURL=str(pattern.search(script.text).group(0)); MYURL=str.replace(MYURL, '\u002D', '-'); print(MYURL)
Forum: Programming 03-08-2020
15,897
Posted By wisecracker
Hi bob123... Which version of python 3.x.x are...
Hi bob123...
Which version of python 3.x.x are you using, OS, and machine...

--- Post updated at 11:41 PM ---

I hope this does not attach itself to the previous...
It looks like you are using...
Forum: Programming 03-08-2020
15,897
Posted By wisecracker
Hi bob123... I don't use BeautifulSoup but...
Hi bob123...

I don't use BeautifulSoup but you could try putting it into a variable, untested:
MYURL=str(pattern.search(script.text).group(0))
print(MYURL)
Forum: What is on Your Mind? 02-20-2020
9,958
Posted By wisecracker
Toshiba’s Optimization Algorithm Sets Speed Record for Solving Combinatorial Problems.
Enjoy...

'https://spectrum.ieee.org/tech-talk/computing/software/toshiba--optimization-algorithm-speed-record-combinatorial-problems'

Copy and paste URL less single quotes...
6,668
Posted By wisecracker
Hi jeo_fb... Assuming you are using...
Hi jeo_fb...

Assuming you are using Longitude and Latitude WRT Earth as a __sphere__ then it is not possible to create a rectangle as Euclidean geometry does not apply.

IF, however you just...
Forum: What is on Your Mind? 02-13-2020
13,003
Posted By wisecracker
Hi Scrutinizer... I must have been asleep as...
Hi Scrutinizer...

I must have been asleep as I have only just seen this...

Congrats matey, you helped me on my way to the *NIX shell environment when I first joined and started AudioScope.sh,...
Forum: What is on Your Mind? 02-07-2020
10,802
Posted By wisecracker
The worlds first classical Chinese program language.
WOW, just WOW...

It would be mighty interesting to see shell code translated to this. Kudos to the young guy who succeeded...
...
15,290
Posted By wisecracker
Hi Michele31416... Thanks for updating...
Hi Michele31416...


Thanks for updating your post with the answer...
28,345
Posted By wisecracker
Hi Ralph.. Is this what you are trying to do? ...
Hi Ralph..
Is this what you are trying to do?
#!/bin/bash
# Linux Mint 19, default bash terminal.
clear
echo ""
echo ""
printf "%b" "This is a test line.\033[s\n"
sleep 2
echo ""
echo ""...
28,345
Posted By wisecracker
I did quote early on in this thread that some...
I did quote early on in this thread that some terminals do not respond correctly to some terminal escape codes. Some of those escape codes will not work at all.

So in the first part the outside...
28,345
Posted By wisecracker
Hi Ralph... Take a look at the two command...
Hi Ralph...

Take a look at the two command below.
The first will give you your terminal size in lines, columns.
IF your terminal can do it, (xterm for example), the second will auto adjust it...
28,345
Posted By wisecracker
An example clearing the screen/window: while...
An example clearing the screen/window:
while true
do
printf "\033[2J\033[H\033[12;30fSome prompt: "
read -r text
doneEDIT:

You can omit the \033[H if you wish but some...
28,345
Posted By wisecracker
Hi Ralph... Some terminals don't always...
Hi Ralph...

Some terminals don't always follow terminal escape codes to the _letter_.
You could try and force the line prompt, force the cursor to the correct position and force clearing after...
Showing results 1 to 25 of 500

 
All times are GMT -4. The time now is 07:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy