Search Results

Search: Posts Made By: homeboy
Forum: Programming 01-07-2012
1,487
Posted By homeboy
Problem about Kernel oops
hello,everyone,I'm reading LDD3.Topics about oops,it said the code bellow would cause a fault condition because "this method copies a string to a local variable,unfortunately,the string is longer...
8,371
Posted By homeboy
Thanks,ahamed!You're right, I optimized the...
Thanks,ahamed!You're right, I optimized the script and fixed the problem temporarily.
8,371
Posted By homeboy
how to prevent process from being killed
Hi,all.Well,I know someone has already asked this question before,however,It's too long before.So i post a new thread here.
Here is the issue.I have a shell script that use awk to calculate...
21,925
Posted By homeboy
Are the two timestamps in one same day?You can...
Are the two timestamps in one same day?You can convert from time string to seconds(starts from 1970/1/1) by date,such as

val1=`date --date="12:02:45" +%s`
val2=`date --date="08:30:00" +%s`
[...
1,036
Posted By homeboy
try this,"file" is the input file sed...
try this,"file" is the input file
sed 's/\(.\)/\1 /g' file | awk '{a=$1||$3;b=$2||$4;printf "%d%d(binary)=%d(decimal)\n",a,b,a*2+b}'
27,864
Posted By homeboy
if you want to put more than one command in such...
if you want to put more than one command in such a command style,you should use brace curly---{},NOT ().The latter means execute these commands in a subshell.Look:

[ true ] && ( echo "yes,you can...
1,036
Posted By homeboy
I can't understand what you mean.
I can't understand what you mean.
3,381
Posted By homeboy
you should quota the second parameter of mv,you...
you should quota the second parameter of mv,you see,if you have a file named "name with blanks",the shell will expand the blanks within variables without double quotas or single quotas or backslash....
3,381
Posted By homeboy
mv $a "`echo $a | sed 's/_/\\ /g'`" there is a...
mv $a "`echo $a | sed 's/_/\\ /g'`"
there is a white space after you replace the "_",the shell will expand that into two strings.
5,400
Posted By homeboy
could you post your complete code?
could you post your complete code?
6,033
Posted By homeboy
clearly,you need to install wget,if you use...
clearly,you need to install wget,if you use ubuntu,you can install it by
sudo apt-get install wget
Installation's similarly in other distributions.
6,033
Posted By homeboy
try this wget...
try this

wget https://www.unix.com/shell-programming-scripting/155750-use-sed.html#post302503291 > newfile.txt
9,164
Posted By homeboy
first,you should know the time you want to...
first,you should know the time you want to compare is "modify time","access time" or "changed time".Command "find" gives some options to do things like that.
4,595
Posted By homeboy
do you means your script will delete "are" and...
do you means your script will delete "are" and "hare" when you only want to delete "are"?
try the "\b" anchor,it match a whole word which is between two \b.
sed 's/\bABC\b//' will delete the...
11,100
Posted By homeboy
try read command exec $command
try
read command
exec $command
993
Posted By homeboy
-eq and others like that are used to compare two...
-eq and others like that are used to compare two numeric variables,if you wanna compare two strings,use "=" and "!="
Forum: Programming 03-11-2011
2,675
Posted By homeboy
yeah,sometimes it won't work by adding...
yeah,sometimes it won't work by adding sync(),such as with my platform and my compiler version,as i said above,mingw works fine.Your solution is a good way to handle this problem.But i'm wondering is...
Forum: Programming 03-11-2011
2,675
Posted By homeboy
yes,i think your solution is same as adding...
yes,i think your solution is same as adding cin.sync().
Forum: Programming 03-11-2011
2,675
Posted By homeboy
is this a bug of g++?
Hello,
Im using the g++(g++ Ubuntu/Linaro 4.4.4-14ubuntu5 4.4.5) and im trying to compile a small snippet code and got into an endless loop.I recompiled that in VS2010 under Windows 7 and the...
7,513
Posted By homeboy
No,it not a function,have you ever learned C?like...
No,it not a function,have you ever learned C?like the while statement.However,the {} is a un-named code blocks here.It just reunion some codes into a space(a local space).One important usage is to...
3,704
Posted By homeboy
man the "grep",i think the option -v and -f are...
man the "grep",i think the option -v and -f are what you're looking for.
7,513
Posted By homeboy
the {} defined a namespace,or say code blocks.It...
the {} defined a namespace,or say code blocks.It groups the codes inside it as a unit.so all output of the code within {} will be redirected to a pipe.
1,480
Posted By homeboy
the option named "-newer" of find maybe suitable...
the option named "-newer" of find maybe suitable for you,try man find
7,513
Posted By homeboy
There're many way to achieve that,here is a...
There're many way to achieve that,here is a intuitive way to do that,redirect the output to a pipe,then replace all "newline" with ",",then use another pipeline to remove the restore the last...
4,338
Posted By homeboy
Thanks all of you,you guys are so kind!!And i...
Thanks all of you,you guys are so kind!!And i love this forum more because of you guys!
Showing results 1 to 25 of 126

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