Search Results

Search: Posts Made By: Tribe
1,721
Posted By bakunin
Are you aware that these stipulations will...
Are you aware that these stipulations will exclude a "linux-something" at the lines end from being removed because there will be no space afterwards? Maybe this is not what you want. Also notice that...
1,721
Posted By MadeInGermany
The previous sample matches and removes leading...
The previous sample matches and removes leading space.
It's also possible with trailing space. With portable perl one can even include TABs
perl -pe 's/linux-\S+\s+//g'Most exact is a "begin...
1,721
Posted By vgersh99
something along these lines: sed 's/[ ][...
something along these lines:

sed 's/[ ][ ]*linux-[^ ][^ ]*//g' myFile
19,364
Posted By RudiC
It looks like (even though we are not dealing...
It looks like (even though we are not dealing with *nix text files due to missing <NL> char at the end) GNU sed could do it, not with octal constants, but with hex constants:
sed ':L;s/\000$//;tL'...
19,364
Posted By Don Cragun
I misunderstood your requirements. Even though...
I misunderstood your requirements. Even though you said you wanted to remove trailing nulls, the way you said that you wanted to stop removing nulls when a different byte was found sounded like you...
Forum: Programming 09-10-2015
6,373
Posted By Don Cragun
You don't need random access for your output...
You don't need random access for your output file. You'll just be doing sequential writes to your output file. You'll also just doing sequential reads from your input file (once you seek to the...
Forum: Programming 09-10-2015
6,373
Posted By Don Cragun
The code has everything to do with it. Why...
The code has everything to do with it.

Why do you believe that you have to copy everything into an array before you write any of your desired output?

Open your input file. Seek to the offset...
Forum: Programming 09-06-2015
6,373
Posted By Don Cragun
OK. Show us the java code and show us where in...
OK. Show us the java code and show us where in the code you are running into buffering problems.
Forum: Programming 09-06-2015
6,373
Posted By Don Cragun
Why use java? This is a perfect problem for the...
Why use java? This is a perfect problem for the dd utility.
Forum: Programming 08-23-2015
1,633
Posted By Don Cragun
For a return from main(), the return code is...
For a return from main(), the return code is equivalent to a call to exit() with that return code. And from the standards, the description of exit(status) is:


For a return from any other...
Forum: Programming 08-23-2015
1,633
Posted By Don Cragun
By convention in the standards: 0 success ...
By convention in the standards:
0 success
1-125 a program specific failure
126 when trying to execute a command, a file was found with the
specified command name, but it was not executable...
Forum: OS X (Apple) 12-14-2014
2,666
Posted By xbin
man stat and man strftime for more details. ...
man stat and man strftime for more details.

stat -f "%Sm" -t "%Y%m%d%H%M.%S" FILE
2,756
Posted By MadeInGermany
If you really would need a ' within a ' ' string...
If you really would need a ' within a ' ' string then you need to end the string with ' then follow an escaped ' then another ' to begin a second string.
echo "some text with spaces" | sh -c 'sed -e...
2,756
Posted By Scrutinizer
A bit of background: sh -c expects a single...
A bit of background: sh -c expects a single string, which is interpreted as a command. Anything after that are positional parameters to that command. So by this way of quoting, sh -c gets passed two...
2,756
Posted By junior-helper
Try echo "some text with spaces" | sh -c 'sed...
Try
echo "some text with spaces" | sh -c 'sed -e "s/ //g"'
and/or
echo "some text with spaces" | sh -c 'sed -e 's/[[:blank:]]//g''
and/or
echo "some text with spaces" | sh -c "sed -e 's/ //g'"
...
1,116
Posted By MadeInGermany
The reason is that >aaa and >bbb are handled by...
The reason is that >aaa and >bbb are handled by the shell.
While it does not matter where you place them, one usually places them at the end.
So your code is identical to
find mydir -type f -exec...
1,046
Posted By Scrutinizer
Hi, Try: stat -c %G "$line"
Hi,

Try:
stat -c %G "$line"
1,116
Posted By jim mcnamara
One way: find mydir -type f | tee -a aaa > bbb...
One way:
find mydir -type f | tee -a aaa > bbb

You do not need echo, find prints by default.
10,649
Posted By balajesuri
1. The %Y format specifier in stat -c command...
1. The %Y format specifier in stat -c command gives the time output in unix time from epoch.
2. I tried the command on Terminal IDE app (BusyBox v1.19.2) installed on my android phone (running...
10,649
Posted By RudiC
You combined file and file system stat queries,...
You combined file and file system stat queries, which does not work. And you gave a format descriptor without the -c or --printf option (on top of the fact that there's no date/time info for file...
10,649
Posted By balajesuri
Here's one way to do it: [user@host ~]$ date -d...
Here's one way to do it:
[user@host ~]$ date -d @$(stat -c%Y file) +"%Y%m%d%H%M%S"
20140118220547
[user@host ~]$
6,428
Posted By Corona688
The cat serves no function in any of these...
The cat serves no function in any of these examples.


< inputfile tee >(openssl md5 > sum.md5) | bzip2 > somefile.bz2
Forum: Programming 11-19-2012
6,971
Posted By radoulov
I believe that you need the OpenSSL headers and...
I believe that you need the OpenSSL headers and you need to install them manually. Use CPAN to install Perl modules, not OS packages.
Forum: Programming 11-19-2012
6,971
Posted By radoulov
Posting the result of cpan <module_name> will be...
Posting the result of cpan <module_name> will be helpful (we don't know what backup.pl contains).

If need to automate the download of the dependencies, you may need to configure the Internet...
Forum: Programming 11-18-2012
6,971
Posted By radoulov
In the CPAN shell: o conf...
In the CPAN shell:

o conf prerequisites_policy follow
o conf build_requires_install_policy yes
o conf commit
Showing results 1 to 25 of 47

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