06-08-2010
Dividir fichero en numero de lineas
Hola,
Estoy haciendo un script y queria de un archivo por ejemplo de 650 lineas, recortarlo y hacer archivos mas pequeños de 100 lineas, y que me salieran 7 archivos, por poner un ejemplo.
No tengo ni idea de hacerlo la verdad....xD
Un saludo y gracias!
7 More Discussions You Might Find Interesting
1. HP-UX
Gostaria que me ajudassem como pesquisar em HP-UX:
-Se ha discos espelhados
-Quantos sao e o respectivo espaco ocupado (1 Reply)
Discussion started by: cgege
1 Replies
2. Shell Programming and Scripting
Hi
I have 2 files where i save the IP adress of many printers that work on UNIX, one of these files, which is the 'Main File', is on a server call PROD, and the other one is on a different server call Al.
What I want, is to make a comparison between the 2 files, and then, copy the IPs that... (4 Replies)
Discussion started by: Athlon1
4 Replies
3. Shell Programming and Scripting
Hola, no se casi nada de linux pero tengo que hacer un tp para la facultad, y uno de los puntos me pide que muestre en pantalla la fecha de creacion , modificacion y ultimo acceso de un fichero pasado por parametro a un script.:confused:
Alguien me ayuda!? gracias. (1 Reply)
Discussion started by: palitodlselva
1 Replies
4. Shell Programming and Scripting
Hi,
I need help urgently.
Something that seems simple, does not come out.
Attempt to insert into a text file page breaks. I need that the execution is fast (as I have to change many files and very large).
I have tried using the sed command to replace the characters "C$" with "\f"C$, but... (5 Replies)
Discussion started by: e437109
5 Replies
5. Shell Programming and Scripting
Hola. Tengo un problema. En un archivo tengo distintos campos y en alguno de ellos y en alguna linea me aparecen ******.
ej:
hola 0.1 ****** 85
adios 1.2 9650 23
gracias 2 ****** 54
bye 87 5666 89
hi ... (1 Reply)
Discussion started by: kekaes
1 Replies
6. Shell Programming and Scripting
Hola a todos les cuento que estoy haciendo un programa en bash y queria saber como puedo hacer para borrar lineas de un documento de las palabras que NO terminen en S con SED, es decir, mostrar solamente las que terminan con la letra S.
les cuento que probe con:
sed -e /$.*/d "$archivo" |... (1 Reply)
Discussion started by: adiegorpc
1 Replies
7. Shell Programming and Scripting
Hola, he empezado la carrera de informática y tengo que hacer uno ejercicios con Cygwin ( mismos comandos que UNIX ).
Y en el ejercicio me dice que tengo que abrir un archivo .csv y que selecione las lineas en que en la tercera columna el valor sea 4 y en la cuarta columna el valor sea 2, he... (1 Reply)
Discussion started by: mcanhizares
1 Replies
LEARN ABOUT ULTRIX
escape
escape(1) Mail Avenger 0.8.3 escape(1)
NAME
escape - escape shell special characters in a string
SYNOPSIS
escape string
DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result.
EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string:
$ var='; echo gotcha!'
$ eval echo hi $var
hi
gotcha!
$
Using escape, one can avoid executing the contents of $var:
$ eval echo hi `escape "$var"`
hi ; echo gotcha!
$
A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For
example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient:
#!/bin/sh
formail -x to -x cc -x resent-to -x resent-cc
| fgrep "$1" > /dev/null
&& exit 0
echo "<$1>.. address does not accept blind carbon copies"
exit 100
To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt
script:
bodytest reject_bcc `escape "$RECIPIENT"`
SEE ALSO
avenger(1),
The Mail Avenger home page: <http://www.mailavenger.org/>.
BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells.
AUTHOR
David Mazieres
Mail Avenger 0.8.3 2012-04-05 escape(1)