Search Results

Search: Posts Made By: gnsxhj
Forum: Cybersecurity 12-16-2010
7,393
Posted By gnsxhj
Thanks for your replay! I have tried your...
Thanks for your replay! I have tried your suggestion, but it seems it doesn't work. By the way, the OS I am using is Suse11.2.
In RedHat I just rename the file
/lib/modules/`uname...
Forum: Cybersecurity 12-15-2010
7,393
Posted By gnsxhj
How to disable USB for storage devices in Suse?
Hello folks, for some confidential reason, I need to disable the USB to access the storage devices in Suse11.2, but I still need two USB for the mouse and keyboard. Anyone knows?
Thanks a lot in...
3,909
Posted By gnsxhj
if u don't mind, i can try this in awk instead of...
if u don't mind, i can try this in awk instead of sed
awk -v FS='[}{]' '{gsub(/\./,"_",$2); print $1"{"$2"}"}' /path/of/file
4,351
Posted By gnsxhj
excellent explanation ! thanks a lot , guys. ...
excellent explanation ! thanks a lot , guys.
ps:
to danmero: r u Chinese? guess by 丹 :-)
4,351
Posted By gnsxhj
The question of FS of AWK
Hi guys,
there is sth of the FS makes me confused, as the following described:
here is a example of the file:

cat file
dir1/file1.txt
dir1/file2.txt
dir1/file3.txt
dir1/file4.txt


what i...
2,930
Posted By gnsxhj
To praneshmishra08: think about this , if i...
To praneshmishra08:
think about this , if i just want to replace the all words starting with "p" which are only in the line starting with "p" ;-)
5,158
Posted By gnsxhj
sed ':a;$!{N;s/\n//;ba;}' maybe i can...
sed ':a;$!{N;s/\n//;ba;}'

maybe i can explain some details of this script:
:a : the label of the branch (u will see ba in the end of script), u can use any alphabet as u wish, so that's a loop of...
5,158
Posted By gnsxhj
the another way to do the 1st : awk '{for...
the another way to do the 1st :
awk '{for (i=NF; i>=1; i--) printf ("%d ",($i>0) ? $i : -1*$i); printf "\n"}' /path/of/file
1,411
Posted By gnsxhj
well, basic on the expr idea of Annihilannic , we...
well, basic on the expr idea of Annihilannic , we can do that as below:

#!/bin/sh
for i in *
do
FILENAME=$(basename $i)
var=$( expr "$FILENAME" :...
37,394
Posted By gnsxhj
Hi Franklin52, what i remember is the bash...
Hi Franklin52,
what i remember is the bash counts the number of the variable from 0, isn't it ?
so, I think that should be:
prefix=echo ${file:0:3}
Regards
7,963
Posted By gnsxhj
another way to do that in bash is : ...
another way to do that in bash is :

#!/bin/sh
FLAG=0
exec 4<&0
exec <$1
while read line
do
FLAG=1
done
echo $FLAG
exec 0<&4 4<&-

$1=the file u want to read
2,071
Posted By gnsxhj
i don't think we have to do it by the script ;-) ...
i don't think we have to do it by the script ;-)
find $path -mtime +2 -a -type f
$path=the directory which u want to scan
+2=u haven't use the file for 2 days
u can use "man find" for the details...
2,337
Posted By gnsxhj
well, i dont know if it is what u want : echo...
well, i dont know if it is what u want :
echo `echo | awk '{print substr("'"$dir"'","'"$pathlength"'")}'`
or:
var=`echo | awk '{print substr("'"$dir"'","'"$pathlength"'")}'`
10,196
Posted By gnsxhj
well, as u said, if the format of the number is...
well, as u said, if the format of the number is fixed ,that should be easy :
sed 's/\([0-9]\{4\}\) /\1,,/' filename
5,205
Posted By gnsxhj
echo -n "enter the text:" read if [[...
echo -n "enter the text:"
read
if [[ ${#REPLY} -gt 50 ]]
then
echo "Error"
fi
217,425
Posted By gnsxhj
echo 'hi' | awk '{split($0,array,"\n")} END{print...
echo 'hi' | awk '{split($0,array,"\n")} END{print array[1]}'
Showing results 1 to 16 of 16

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