Estas viendo esta página como Invitado.
Regístrate GRATIS para disfrutar de todas las ventajas de HispaZone.
uso de sort - HispaZone: Comunidad de Hardware y Overclocking
HispaZone: Comunidad de Hardware y Overclocking

    
Navigation
Regresar   HispaZone: Comunidad de Hardware y Overclocking > Sistemas Operativos > Unix / Linux / BSD / Solaris / Mac
Unix / Linux / BSD / Solaris / Mac Red Hat, Ubuntu, Debian, Solaris, BSD, Unix y todo lo relacionado con GNU y Mac.

Responder
 
LinkBack Herramientas

  #1 (permalink)
Anterior 04-ene-2007, 10:30
HZ Aprendiz
 
Registrado: enero-2007
Edad: 29
Posts: 5
Predeterminado uso de sort

Buenas, os muestro con un more le contenido del fichero borra.
Bien, me gustaría ordenar este fichero o bien por el campo1, op por el campo 2 ... dependiendo del momento. Para hacerlo, estoy utilizando el comando "sort",pero no entiendo por que siempre me hace la misma ordenacion. MAs abajo tambien os pongo el resultado

ayuda please

# more borra
3,true,10,10,"CBPSAX-4500",false,false,"V11.01.C04"
1,true,10,10,"ACPSAX2300-2",false,false,"V11.01.C04"
2,true,10,10,"VDPSAX-1250",false,false,"V10.00.C07"


# sort +1 borra
1,true,10,10,"ACPSAX2300-2",false,false,"V11.01.C04"
2,true,10,10,"VDPSAX-1250",false,false,"V10.00.C07"
3,true,10,10,"CBPSAX-4500",false,false,"V11.01.C04"


# sort +0 borra
1,true,10,10,"ACPSAX2300-2",false,false,"V11.01.C04"
2,true,10,10,"VDPSAX-1250",false,false,"V10.00.C07"
3,true,10,10,"CBPSAX-4500",false,false,"V11.01.C04"


# sort +2 borra
1,true,10,10,"ACPSAX2300-2",false,false,"V11.01.C04"
2,true,10,10,"VDPSAX-1250",false,false,"V10.00.C07"
3,true,10,10,"CBPSAX-4500",false,false,"V11.01.C04"

# sort +5 borra
1,true,10,10,"ACPSAX2300-2",false,false,"V11.01.C04"
2,true,10,10,"VDPSAX-1250",false,false,"V10.00.C07"
3,true,10,10,"CBPSAX-4500",false,false,"V11.01.C04"
javierg está desconectado   Citar y responder
  #2 (permalink)
Anterior 04-ene-2007, 12:24
HZ Team
 
Registrado: enero-2004
Ubicación: Valencia
Posts: 1,853
Predeterminado Re: uso de sort

En linux existe una cosa llamada manual, que se invoca con el comando: "man".
Si hubieras hecho "man sort" y hubieras leido el manual (RTFM), hubieras encontrado esto:

-t separator
Use character separator as the field separator when finding the
sort keys in each line. By default, fields are separated by the
empty string between a non-whitespace character and a whitespace
character. That is to say, given the input line ` foo bar',
sort breaks it into fields ` foo' and ` bar'. The field separa-
tor is not considered to be part of either the field preceding
or the field following it.

Editado por Drazhaz en 04-ene-2007 a las 02:05 .
Drazhaz está desconectado   Citar y responder
Responder



Personas en esta discusión: 1 (0 usuario(s) y 1 invitado(s))
 
Herramientas

Reglas del foro
No puedes publicar nuevas discusiones
No puedes responder a discusiones
No puedes publicar archivos adjuntos
No puedes editar tus posts

BB code is activado
Emotíconos está activado
El código [IMG] está activado
El código HTML está desactivado
Trackbacks are activado
Pingbacks are activado
Refbacks are activado


Todas las horas son GMT +2. La hora es 07:21 .
Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0