Search Results

Search: Posts Made By: yanglei_fage
1,472
Posted By yanglei_fage
sorry, my typo, I just updated it ----------...
sorry, my typo, I just updated it

---------- Post updated at 01:54 AM ---------- Previous update was at 01:28 AM ----------

I tried awk '{print NR, "\t", $0}', but it adds each line with number...
1,472
Posted By yanglei_fage
I'm using bash or sh shell on ubuntu
I'm using bash or sh shell on ubuntu
1,472
Posted By yanglei_fage
Add number prepend certain lines
from

a(depends: )
bb(depends:lmbench )
cc(depends: )
CONFIG_DEFAULT1=y
CONFIG_IOSCHED1=y
CONFIG_CGROUP1=y
ddd(depends: )
CONFIG_GENERIC_CPU1=y
CONFIG_CRYPTO_AES_NI1=m...
935
Posted By yanglei_fage
One line to to get CONFIG_XX=y
#config test.txt
CONFIG_DEBUG_RODATA_TEST=y
# CONFIG_DEBUG_SET_MODULE_RONX is not set
# CONFIG_DEBUG_NX_TEST is not set
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_TLBFLUSH is not set
#...
1,309
Posted By yanglei_fage
there is misunderstanding here it's not antoher...
there is misunderstanding here
it's not antoher user to run the script, it's another user to run the function
you can check my code "su -m hadoop -c 'user_func' ", hadoop is another user that I...
1,309
Posted By yanglei_fage
nothing special in my .profile or bashrc, I'm...
nothing special in my .profile or bashrc, I'm using ubuntu
1,309
Posted By yanglei_fage
Help: run with another user, env disappear
#!/bin/sh
PATH_1=$PATH
echo "PATH_1 is " $PATH_1
function user_func (){
whoami
export PATH=$PATH_1:/usr/local/bin
echo "PATH is" $PATH
exit
}
export -f user_func
su -m hadoop -c...
1,080
Posted By yanglei_fage
Blabla indicate the next line is Jim...
Blabla indicate the next line is Jim...
1,080
Posted By yanglei_fage
Get value from row and column
file.txt

Blablabla
Jim John Lucy
a Y N Y
b N Y N

Blablabla tells the nextline is "Jim, John…”
I want a function or online get the value
For example
...
2,558
Posted By yanglei_fage
after I use run_test >(tee -a x.log) ...
after I use

run_test >(tee -a x.log)


it works, but if I add sleep 100s in function run_test, it doesn't kill the "sleep 100" after 5s(timeout)

anyone can help me ?
2,558
Posted By yanglei_fage
things get better, but I find if I change the...
things get better, but I find if I change the "sleep 1" to "sleep 100", after 5s, it doesn't kill the "sleep 100", and looks it doesn't kill the mainpid too, so the cleanup doesn't execute.

BTW,...
2,558
Posted By yanglei_fage
it doesn't work. nothing changes
it doesn't work. nothing changes
2,558
Posted By yanglei_fage
I'm on "Ubuntu 12.04.4 LTS \n \l" without...
I'm on "Ubuntu 12.04.4 LTS \n \l" without terminate running this script

lyang001@lyang001-OptiPlex-9010:~/nehalem_workdir$ echo $SHELL
/bin/bash
...
2,558
Posted By yanglei_fage
after I removed i=$((i+1)), it doesn't work like...
after I removed i=$((i+1)), it doesn't work like your side

I want get
after 5s (timeout=5), the script will be stopped and with it's subprocess stopped too, and alos get where it stopped, here...
2,558
Posted By yanglei_fage
Timeout doesn't work, please help me
#!/bin/sh
trap "cleanup" TERM
timeout=5
mainpid=$$
cleanup()
{
echo "at $i interupt"
kill -9 0
}


watchdog()
{
sleep $1
}


(watchdog $timeout && kill -TERM $mainpid) &...
1,996
Posted By yanglei_fage
I expect the line that contains binutils1_test to...
I expect the line that contains binutils1_test to be print, which maybe contains space or tab, I don't care
1,996
Posted By yanglei_fage
I just want to match the line is binutils1_test
I just want to match the line is binutils1_test
1,996
Posted By yanglei_fage
Help match the exact string
I just want to match "binutils1_test" only, and print the match line only


lyang001@lyang001-OptiPlex-9010:/tmp$ cat file
zbinutils1_test
bbinutils1_test
binutils1_test
...
1,819
Posted By yanglei_fage
Help for exiting the function not script
function2()
{
cmd1
cmd2
cmd3
....
cmdn
}

function2()
{
cmd11
cmd12
cmd13
....
....

}

for i in {1,2}
1,310
Posted By yanglei_fage
That's not what I wanted, I just give the example...
That's not what I wanted, I just give the example that I need to exit 0 intentionally, can you help me to re-write the cmd function
to achieve this ?
1,310
Posted By yanglei_fage
Help to cd to a dirctory and not exit after cmd
cmd()
{
results=`eval $* 2>&1`
val=$? #return the $* execution value
}



cmd "cd /home/tom || exit 0"


how to realize two point

it cd to "/home/tom"
not exit from the...
1,004
Posted By yanglei_fage
f() { echo "xx" if tty -s; then...
f()
{
echo "xx"
if tty -s; then
exec 3> /dev/null
else
exec 3>&2
fi
echo "failed" 1>&3
}

f > x




I don't see the "failed"...
1,004
Posted By yanglei_fage
Print the one function's log to the screen
c()
{
if something failed;then
echo "failed"
exit 1
fi
}

f()
{
functinona #if something failed call "c"
functionb #if something failed call "c"
}

f > log 2>&1...
1,303
Posted By yanglei_fage
Why don't kill the script after 5s?
# watchdog process
mainpid=$$
(sleep 5; kill $mainpid) &
watchdogpid=$!
sleep 100
kill $watchdogpid

The sleep isn't be killed, I want the script to be killed

---------- Post updated...
2,070
Posted By yanglei_fage
yes, I modified it :(
yes, I modified it :(
Showing results 1 to 25 of 307

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