Search Results

Search: Posts Made By: Tribe
1,626
Posted By Tribe
Any of the two work, because the apt command uses...
Any of the two work, because the apt command uses space as argument separator, when there are one or more spaces at the end they are ignored and two or more spaces in any place are condensed into one.
1,626
Posted By Tribe
Remove all matches containing a string until its next space
I want to delete all matches in a text following this pattern:


Each match starts with linux-
Each match ends with a space
(Remove linux-* until immediate next space)



EXAMPLE:
From...
19,014
Posted By Tribe
At the end of a binary file
At the end of a binary file
19,014
Posted By Tribe
No idea what can be the cause, but with large...
No idea what can be the cause, but with large files it doesn't remove all the trailing null characters.

A file of 3239571456 bytes resulted in 2902450247 with dtn.c
The same file resulted in...
19,014
Posted By Tribe
Thank you very much, it works perfectly.
Thank you very much, it works perfectly.
19,014
Posted By Tribe
That command removes all nulls. I need to remove...
That command removes all nulls. I need to remove only the ones that are at the end of the file just after the last non-null character, not in the middle of the file.
19,014
Posted By Tribe
Remove or truncate trailing nulls from file
I want to remove from a file the trailing null characters (0x00) and stop doing so when a different byte is found (which should not be deleted), and either put the result to the same file or a...
1,098
Posted By Tribe
My mistake. It's python, not perl. I wrote...
My mistake. It's python, not perl. I wrote incorrectly the thread title.




It doesn't matter because we are passing by value, not by reference, which is what @Aia suggests (reading from...
1,098
Posted By Tribe
How to send to python the content of a bash variable as argument?
I want to send the content of a bash variable as a python argument for processing. The problem is that bash doesn't "expand" the content, just sends the expression.

script.sh#!/bin/bash
export...
Forum: Programming 09-10-2015
6,356
Posted By Tribe
So do you think RandomAccessFile will be the...
So do you think RandomAccessFile will be the simplest way to achieve that? If I write byte by byte is may cause a lot of I/O overhead, specially bad for SSD drives. Writing in blocks of 1MB or so I...
Forum: Programming 09-10-2015
6,356
Posted By Tribe
I'm not sure I need to show internal code that...
I'm not sure I need to show internal code that has nothing to do with it. Basically I think the issue comes from the maximum number of items into a byte array. Say an example program already contains...
Forum: Programming 09-06-2015
6,356
Posted By Tribe
Because the software that detects the start and...
Because the software that detects the start and end offsets is entirely written in java, and I want it to be portable.
Forum: Programming 09-06-2015
6,356
Posted By Tribe
Extract part of an archive to a different file
I need to save part of a file to a different one, start and end offset bytes are provided by two counters in long format. If the difference is big, how should I do it to prevent buffer overflow in...
Forum: Programming 08-23-2015
1,622
Posted By Tribe
And what about negative numbers? I've seen the...
And what about negative numbers? I've seen the return -1; quite often
Forum: Programming 08-23-2015
1,622
Posted By Tribe
Return or exit codes apart from 0 have a meaning?
The standard return code when everything goes right is 0, but what about using any other number something happened? Are there "ranges" depending on the kind of problem you want to express or is...
19,438
Posted By Tribe
printf is not available on android, os x or...
printf is not available on android, os x or freebsd so isn't really portable. I'll stick with the sed option.
19,438
Posted By Tribe
Remove leading dot and slash on relative paths with find
When I specify a directory by name the leading ./ is not shown:
$ find somedir/
somedir/a.bin
somedir/target/out.binBut when I specify current dir it adds the ./ to the beginning of each result:...
Forum: OS X (Apple) 12-14-2014
2,629
Posted By Tribe
[OS X] Last modification time from shell in CCYYMMDDhhmm.ss format
This example shows last mtime from epoch
$ stat -f %m somefile
752911565

But would like to see it like that:
199311100606.05
2,718
Posted By Tribe
Can't remove spaces with sed when calling it from sh -c
The following command works echo "some text with spaces" | sh -c 'sed -e 's/t//g''But this doesn't and should echo "some text with spaces" | sh -c 'sed -e 's/ //g''Any ideas?
1,034
Posted By Tribe
Thanks worked!
Thanks worked!
1,034
Posted By Tribe
Working with lines or variables that have spaces or special characters
Example:
while read line
do
stat -c %G $line
done < somefile.txtThe problem is that inside somefile.txt lines can have any symbol allowed as file name, like (). Even with spaces, it splits the...
1,092
Posted By Tribe
Several exec on find send all the output to the last redirection
Example script:

find mydir -type f -exec echo {}>aaa \; -exec echo {}>bbb \;The two paths go the the bbb file, while there should be one of them on each file. How should I do it to get it working?
10,597
Posted By Tribe
$ date -d @$(stat -c%Y file) +"%Y%m%d%H%M%S" ...
$ date -d @$(stat -c%Y file) +"%Y%m%d%H%M%S"
unknown option -- ddate: invalid option -d
10,597
Posted By Tribe
This example works perfectly on Cygwin, however...
This example works perfectly on Cygwin, however it doesn't on android, where timestamps are always read and written in unix time from epoch.
10,597
Posted By Tribe
How to read and write last modified timestamp to files?
Need help reading file last modified date in format:

Filename (relative path);YYYYMMDDHHMMSS

And then write it back. My idea is to backup it to a text file to restore later.


Checked this...
Showing results 1 to 25 of 54

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