Unix/Linux Go Back    

Showing results 1 to 25 of 500
Search took 0.09 seconds.
Search: Posts Made By: wisecracker
Forum: Shell Programming and Scripting Linux 3 Weeks Ago
Replies: 10
Views: 318
Posted By wisecracker
I have been looking at the file structure: 1)...

I have been looking at the file structure:
1) All lines start with the " ", single space, character as an absolute minimum, are these indents and need to be preserved?
2) If so then line 1 is...
Forum: Solaris Linux 3 Weeks Ago
Replies: 11
Views: 454
Posted By wisecracker
Try a Python approach through bash. #!/bin/bash...

Try a Python approach through bash.
#!/bin/bash
# epoch.sh
# Usage: ./epoch.sh YYYYMMDD
EPOCH=$1
if [ "$EPOCH" == "" ]
then
exit 1
fi
echo '#epoch.py
Forum: Solaris Linux 3 Weeks Ago
Replies: 11
Views: 454
Posted By wisecracker
This might be of interest or help: ...

This might be of interest or help:
https://www.unix.com/unix-for-beginners-questions-and-answers/239167-general-purpose-date-script.html
Courtesy of Corona688.
EDIT:
A little bit of googling......
Forum: UNIX for Beginners Questions & Answers Linux 3 Weeks Ago
Replies: 6
Views: 207
Posted By wisecracker
There is of course tr . Assuming the file...

There is of course tr .
Assuming the file structure remains the same as is shown.
tr -d "-" < /path/to/infile > /path/to/outfile
Forum: What is on Your Mind? Linux 4 Weeks Ago
Replies: 3
Views: 252
Posted By wisecracker
Hi... (Apologies for any typos.) I decided to...

Hi...
(Apologies for any typos.)
I decided to try the Python code supplied in the wiki URL...
No alteration to the code, Python 2.7.10 - OSX default, and Python 3.5.2 on the same machine, both are...
Forum: What is on Your Mind? Linux 4 Weeks Ago
Replies: 3
Views: 252
Posted By wisecracker
PI calculated by hand. If this doesn't blow your mind nothing will.

This came to my attention very recently...
I have put it here as a fun item not related to UNIX in any way...

Chudnovsky algorithm - Wikipedia (https://en.wikipedia.org/wiki/Chudnovsky_algorithm)...
Forum: OS X (Apple) Linux 4 Weeks Ago
Replies: 1
Views: 488
Posted By wisecracker
PI day.

Hi guys and gals...
OSX 10.13.3, default bash terminal calling ksh in the code.
I decided to have a go at creating PI using ksh only as a bit of fun.
I also decided on a Taylor series to do such a...
Forum: Shell Programming and Scripting Linux 03-13-2018
Replies: 5
Views: 832
Posted By wisecracker
I will add to Don's reply how are you going to...

I will add to Don's reply how are you going to catch a strange error that completely exits your result.sh .
The code below will NEVER reach your exit 167 ...
For example try this, I have called...
Forum: Shell Programming and Scripting Linux 03-09-2018
Replies: 5
Views: 832
Posted By wisecracker
Your 'NOP' : is just that a 'NOP' with a...

Your 'NOP' : is just that a 'NOP' with a meaningless argument of $(./return.sh) so its RC will always be zero, '0'.
[Prompt]./return.sh 2>&1 > /dev/null
[Prompt]echo "$?"
This will suppress...
Forum: OS X (Apple) Linux 02-05-2018
Replies: 7
Views: 932
Posted By wisecracker
Yes, that was why I used my original 'hexdump'...

Yes, that was why I used my original 'hexdump' method as that placed just a single <space> character into each cell.
However RudiC's solution is the one I will use.
The way he creates the array...
Forum: OS X (Apple) Linux 02-05-2018
Replies: 7
Views: 932
Posted By wisecracker
Hi RudiC... You are a star, works with spaces...

Hi RudiC...
You are a star, works with spaces and in this test case too.
#!/bin/bash

# Only 14 elements here.
printf "ABCDEFGHIJKLMN" > /tmp/ARRAY

IFS="" read TMP < /tmp/ARRAY
for ((i=0;...
Forum: OS X (Apple) Linux 02-05-2018
Replies: 7
Views: 932
Posted By wisecracker
Hi RudiC... Yes I do mean ASCII character...

Hi RudiC...
Yes I do mean ASCII character '0x20'...
'stat' does not have the '-c' option and 'man stat' does not show any alternative.
'seq' is forced into error too:-
(/tmp/ARRAY does exist in...
Forum: OS X (Apple) Linux 02-05-2018
Replies: 7
Views: 932
Posted By wisecracker
Create a bash array from a flat file of whitespaces only.

Hi guys and gals...
MacBook Pro.
OSX 10.13.2, default bash terminal.
I have a flat file 1920 bytes in size of whitespaces only. I need to put every single whitespace character into a bash array...
Forum: Shell Programming and Scripting Linux 01-26-2018
Replies: 6
Views: 412
Posted By wisecracker
Hello alii... First of all put your...

Hello alii...

First of all put your requirements inside code tags something like this as per the site's requirements.
Next, what have you attempted so far.
Which Operating System you are...
Forum: War Stories Linux 01-25-2018
Replies: 5
Views: 973
Posted By wisecracker
Perhaps, perhaps not; a hardware design problem...

Perhaps, perhaps not; a hardware design problem that goes back decades just to get performance figures to sell their CPUs is more than bad to say the least - especially when the manufacturers knew...
Forum: War Stories Linux 01-24-2018
Replies: 5
Views: 973
Posted By wisecracker
Linus Torvalds reply about Meltdown and Spectre.

Apologies if this is the wrong forum but...

...This is hard hitting stuff.

LKML: Linus Torvalds: Re: [RFC 09/10] x86/enter: Create macros to restrict/unrestrict Indirect Branch Speculation...
Forum: Security Linux 01-20-2018
Replies: 8
Views: 1,259
Posted By wisecracker
Hi RuciC... Not sure if this is relevant to...

Hi RuciC...

Not sure if this is relevant to you or this thread but we dealt with EADS several years ago and they tore Skype apart for its obfuscation and untrustworthy code:
...
Forum: UNIX for Advanced & Expert Users Linux 01-15-2018
Replies: 9
Views: 843
Posted By wisecracker
Of course there is always 'printf' and could...

Of course there is always 'printf' and could easily be in a 'read' loop...
OSX 10.13.2, default bash terminal.
Longhand to show it working...
Last login: Mon Jan 15 16:11:31 on ttys000...
Forum: Shell Programming and Scripting Linux 12-23-2017
Replies: 14
Views: 949
Posted By wisecracker
Hi rovf... Don was VERY accurate when...

Hi rovf...

Don was VERY accurate when quoting what the OP's variables are to be like.

Here is another example and there are so, so many more after experimentation that UNLESS the OP can...
Forum: Shell Programming and Scripting Linux 12-22-2017
Replies: 14
Views: 949
Posted By wisecracker
Hi rovf... Longhand OSX 10.12.1, default bash...

Hi rovf...
Longhand OSX 10.12.1, default bash terminal.
As Don has suggeted with his code it works with the given sample and fine it is.

However...
Last login: Fri Dec 22 20:42:33 on ttys000...
Forum: Shell Programming and Scripting Linux 12-22-2017
Replies: 14
Views: 949
Posted By wisecracker
Hi rakeshkumar... OSX 10.13.0, default bash...

Hi rakeshkumar...
OSX 10.13.0, default bash terminal.
If I am reading this thread correctly...
...to add to the other guys statements can you guarantee things like these will never occur:
Last...
Forum: Shell Programming and Scripting Linux 12-20-2017
Replies: 5
Views: 14,309
Posted By wisecracker
Hi pavand... Before asking for help get you...

Hi pavand...

Before asking for help get you output requirements correct first.

You OUTPUT shows 4 lines of 9 characters, (ALL identical?), instead of 8 lines of 8 characters, (ALL identical?)....
Forum: What is on Your Mind? Linux 12-09-2017
Replies: 4
Views: 355
Posted By wisecracker
Thanks but... Certainly not, I rather like...

Thanks but...

Certainly not, I rather like it... ;o)

EDIT:

I have tried to thank your post twice but it looks as though it is not working.
Clicking on Thanks just removes the button here......
Forum: What is on Your Mind? Linux 12-09-2017
Replies: 4
Views: 355
Posted By wisecracker
The green pop-ups...

Admins...

I just lerve the pop-ups that appear whilst replying to someones post.

It reminds me of "Paperclip" from my MS Windows days... ;oDD

Love it, as it makes me smile, telling me I am...
Forum: UNIX for Beginners Questions & Answers Linux 12-09-2017
Replies: 6
Views: 425
Posted By wisecracker
Hi andysensible... An additional note to...

Hi andysensible...

An additional note to Scrutinzer's post...

This is the only reply, in the few that have been posted, that is fully POSIX compliant and will work in 'sh' and 'dash' too, thus...
Showing results 1 to 25 of 500

 


All times are GMT -4. The time now is 01:13 AM.