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 1 Week Ago
Replies: 10
Views: 548
Posted By wisecracker
Hi pchang... First observations are: ...

Hi pchang...

First observations are:

You seem to have a flat file of pure spaces, ASCII character 0x20.
The printout is little endian.
The file has 2 occasions of a WINDOWS style <CR><NL>...
Forum: Shell Programming and Scripting Linux 1 Week Ago
Replies: 11
Views: 374
Posted By wisecracker
Hi primo102... Just an observation and...

Hi primo102...

Just an observation and slightly off topic and assumes bash.
I have no idea which OS you are using but there are now various Linux flavours that use terminal __windows__ of varying...
Forum: What is on Your Mind? Linux 3 Weeks Ago
Replies: 12
Views: 512
Posted By wisecracker
Hi Neo... Good one, I only noticed one...

Hi Neo...

Good one, I only noticed one error:

Data Logging paragraph:
"""
UNIX.COM also users this information
"""

Should read:
Forum: UNIX for Beginners Questions & Answers Linux 3 Weeks Ago
Replies: 13
Views: 378
Posted By wisecracker
I was well aware of the situation but he did...

I was well aware of the situation but he did stress that he wanted it in UNIX format in an earlier post.
Good point though, but it is just as easy to put '\r\n's back if that becomes a necessity.
Forum: UNIX for Beginners Questions & Answers Linux 3 Weeks Ago
Replies: 13
Views: 378
Posted By wisecracker
Hi geomarine... Think of your problem and...

Hi geomarine...

Think of your problem and how to get round it.
You want a single file in UNIX format.

Here is a DEMO of your two files:
#!/bin/sh
# All longhand to see the sequence of...
Forum: Shell Programming and Scripting Linux 3 Weeks Ago
Replies: 3
Views: 324
Posted By wisecracker
Again I have no idea why so convoluted a method...

Again I have no idea why so convoluted a method as your function:
DEMO:
#!/usr/bin/python2.7

mylist = [ "hello", "you", "are", "so", "cool" ]

STRING = ' '.join(mylist)
NEWSTRING =...
Forum: Shell Programming and Scripting Linux 3 Weeks Ago
Replies: 3
Views: 324
Posted By wisecracker
Hi skysmart... I have no idea what you are...

Hi skysmart...

I have no idea what you are trying to do but your function is not called.
I guess you are trying to put that function in the interpreter namespace for other uses.

The function...
Forum: What is on Your Mind? Linux 05-19-2018
Replies: 2
Views: 252
Posted By wisecracker
The BOFH...

I was in converstion with a friend and got talking about getting help from centres that are supposedly the experts at a particular field WRT to their own item that they have sold. This is usually...
Forum: Shell Programming and Scripting Linux 05-17-2018
Replies: 14
Views: 454
Posted By wisecracker
H srini... emp|^^|ename|^^|sal|^^|refname ...

H srini...
emp|^^|ename|^^|sal|^^|refname
"PM"|^^|"R""A""M"|^^|100|^^|"X"""YZ"
"RM"|^^|"PR
RED""
ORANG""
SRI"|^^|500|^^|"ABCD"
"AM"|^^|"""MAR"""|^^|200|^^|"ABC"""
Just an observation here, on...
Forum: Shell Programming and Scripting Linux 05-16-2018
Replies: 2
Views: 269
Posted By wisecracker
Hi... I am missing something, why do you...

Hi...

I am missing something, why do you need a python script to be piped into python?
You are already calling python in your shebang...
Longhand OSX 10.13.4, default bash terminal.
Last login:...
Forum: OS X (Apple) Linux 05-15-2018
Replies: 1
Views: 756
Posted By wisecracker
I forgot to mention one important part: Change...

I forgot to mention one important part:
Change this line from echo 'set theFilePath to "/Users/amiga/Desktop/Spy.mov"
to echo 'set theFilePath to "/Users/your_user_name/Desktop/Spy.mov" ...
And...
Forum: OS X (Apple) Linux 05-09-2018
Replies: 1
Views: 756
Posted By wisecracker
Let your iMac/MBP detect a burglar whilst idle...

Hi folks...
(Apologies for typos.)

I have been working on a very simple MacBook_Pro/iMac centric project. I have called it Spy .
If you just want to test for fun you only need ./Spy and this...
Forum: Shell Programming and Scripting Linux 03-29-2018
Replies: 10
Views: 366
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 03-27-2018
Replies: 11
Views: 591
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 03-27-2018
Replies: 11
Views: 591
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 03-26-2018
Replies: 6
Views: 323
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 03-19-2018
Replies: 3
Views: 293
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 03-18-2018
Replies: 3
Views: 293
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 03-18-2018
Replies: 1
Views: 760
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: 962
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: 962
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: 1,036
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: 1,036
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: 1,036
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: 1,036
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...
Showing results 1 to 25 of 500

 


All times are GMT -4. The time now is 04:07 PM.