Search Results

Search: Posts Made By: 3Gmobile
1,763
Posted By 3Gmobile
sed script
how to convert the follow sed script file into a command line ?

example:
/^\.TS/,/^\.TE/{
/^$/p
}


I have tried the below but it is not working:
# sed -n "/^\.TS/,/^\.TE/{/^$/p}"...
2,060
Posted By 3Gmobile
quoting in conditional statement
can somebody help, what quote i should use in below statement or what wrong of it ?
the 1st (*) is a char, the 2nd and 3rd (*) is a wildcard


if [[ "$a" = * -o "$a" = *$c* ]] && [[ $d = abc...
6,360
Posted By 3Gmobile
thanks i got it, the grep is different ??
thanks i got it, the grep is different ??
6,360
Posted By 3Gmobile
Solaris10 # uname -a SunOS test 5.10...
Solaris10

# uname -a
SunOS test 5.10 Generic_118822-27 sun4u sparc SUNW,Ultra-250
# echo $0
-ksh
6,360
Posted By 3Gmobile
thanks you
oh.. both grep and egrep not work too

grep: illegal option -- q
Usage: grep -hblcnsviw pattern file . . .
6,360
Posted By 3Gmobile
# check if variable 'a' contains 'you' if...
# check if variable 'a' contains 'you'

if echo "$a" | grep -q you
then
echo "Variable a contains 'you'"
fi

I have the following output ---->
egrep: illegal option -- q
usage: egrep [...
7,836
Posted By 3Gmobile
sort syslog messages
how can i sort the syslog message, so that the lastest time stamp show first , oldest show last.
4,645
Posted By 3Gmobile
# time find / -name host* .... .... .... ...
# time find / -name host*
....
....
....

real 0m12.63s
user 0m1.82s
sys 0m8.44s

#
6,360
Posted By 3Gmobile
question on sed grep awk from variable
i am still confusing on how to use sed, grep and awk if the input is not a file but a variable.

such as:

a="hello world"
b="how are you"
c="best wish to you"
d="222,333,444"

what if i...
28,886
Posted By 3Gmobile
in fact YY:ZZ pattern need to match, if match the...
in fact YY:ZZ pattern need to match, if match the output will
10:30:XX:YY:ZZ:<code>
if not then
10:30:XX:YY:ZZ:00000

the file will look like this:
<code> YY:ZZ
TEM01 13:JUL
BAK01 14:DEC...
28,886
Posted By 3Gmobile
thanks, How if i have another condition...
thanks,

How if i have another condition need to match , such as, the ZZ value is contain in another file ? If ZZ contain in the file , then ZZ will be 00.
3,730
Posted By 3Gmobile
could you help to explain what does it mean ?? ...
could you help to explain what does it mean ??

${i%%=*}=$(echo "${i##*=}

thanks you !
3,730
Posted By 3Gmobile
obtain a new variable out of "for statment"
first i have pre-define some variable, then input those into a for statement for some process, finally, i want to get a new value out of it.

A=192.168.16.1
B=192.168.32.1
C=192.168.64.1

for i...
28,886
Posted By 3Gmobile
sorry how if my input field is...
sorry
how if my input field is HH:MM:XX:YY:ZZ..... and i want to replace the MM with either 00 or 30 ?

thanks
28,886
Posted By 3Gmobile
oh, thanks ! i got it...
oh, thanks ! i got it...
28,886
Posted By 3Gmobile
thank ! but how can i make the output to be...
thank !

but how can i make the output to be 00 instead of only contain one 0
2,595
Posted By 3Gmobile
while i am waiting other to help on my question,...
while i am waiting other to help on my question, let me explain it to you !!

grep "hello" $myfile >> $log -----> all standard output will go into $log, except error which will output to your...
28,886
Posted By 3Gmobile
awk conditional statement
how can i use awk or sed to do a conditional statement, so that
HH:MM
if MM not great than 30 , then MM=00
else MM=30

ie:
10:34 will display 10:30
10:29 will display 10:00

a=$(echo 10:34...
Showing results 1 to 18 of 18

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