Search Results

Search: Posts Made By: Tribe
17,986
Posted By guruprasadpr
Hi sed 's/[^0-9]*//' file Guru.
Hi

sed 's/[^0-9]*//' file

Guru.
1,683
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,683
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,683
Posted By vgersh99
something along these lines: sed 's/[ ][...
something along these lines:

sed 's/[ ][ ]*linux-[^ ][^ ]*//g' myFile
19,237
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,237
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,365
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-06-2015
6,365
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 09-06-2015
6,365
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-10-2015
6,365
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 08-23-2015
1,628
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,628
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...
14,276
Posted By agama
The convert utility which is a part of...
The convert utility which is a part of imagemagick will do what you need. Basic command line is:


convert +append image1.jpg image2.jpg product.jpg


The two images are placed side by side;...
Forum: OS X (Apple) 12-14-2014
2,651
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,737
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,737
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,737
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,100
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,037
Posted By Scrutinizer
Hi, Try: stat -c %G "$line"
Hi,

Try:
stat -c %G "$line"
1,100
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,633
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,633
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 ~]$
10,633
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...
37,436
Posted By rajeshwar_ancha
Abrahao, You can use rcp command instead to...
Abrahao,

You can use rcp command instead to retain modification times access times and modes of the original file. (Use rcp -p)

If you want to change access/modification times use touch...
37,436
Posted By Sabari Nath S
Hi Abrahao, I think u can better tar the...
Hi Abrahao,

I think u can better tar the files , ftp it and untar it at the other end ... and the timestamp would be preserved ... try this way ... i guess this wud be better than changing the...
Showing results 1 to 25 of 47

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