Sponsored Content
Full Discussion: sed magic!
Top Forums Shell Programming and Scripting sed magic! Post 302228747 by Franklin52 on Monday 25th of August 2008 10:26:47 AM
Old 08-25-2008
Something like this?

Code:
sed 's/.*/&XPTO/' file > newfile

Regards
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Boot Magic 7

For a multi-boot setup (win2K, XP & SuSE) over 3 drives, where should Boot Magic be installed to? And does it matter which o/s installs it? (3 Replies)
Discussion started by: onestepto
3 Replies

2. UNIX for Advanced & Expert Users

what is magic file ?

i am working under this sysytem SunOS sparc SUNW,UltraAX-i2 Some system on this server creates a file named like this. Elem_ee.xml.gz Elem_ee.xml.gz.magic In order to look into Elem_ee.xml.gz.magic, i first renamed Elem_ee.xml.gz.magic to Elem_ee.xml.gz and tried to unzip it. but returns... (3 Replies)
Discussion started by: oppai
3 Replies

3. UNIX for Dummies Questions & Answers

Partion Magic problems.

Hiya people, A great big "HI" to everybody. I'm new to the Forum and now to my problem(s). I am about to partition my only 80GB HD and using the Partition Magic 8 software it looks fairly simple although here is my problem :- 1. Do I change the new partition to primary or logical? 2. Do I... (4 Replies)
Discussion started by: Syndrome_00
4 Replies

4. UNIX for Dummies Questions & Answers

magic.h

Where can I find #defines for filetypes like the ELF etc and the magic.h file? CAn anyone advice. Thanks in advance. (0 Replies)
Discussion started by: vijlak
0 Replies

5. UNIX for Advanced & Expert Users

magic.h

Where can I find #defines for filetypes like the ELF etc and the magic.h file? CAn anyone advice. Thanks in advance. (1 Reply)
Discussion started by: vijlak
1 Replies

6. UNIX for Dummies Questions & Answers

magic 8ball

when i use this code for the script of the magic 8ball, i get an error message and it always displays the sam answer. What am i doing wrong or what am i missing thanks #!/bin/sh #< Magic eight ball! # KW 26/11/04 # Requires "rand" echo "Enter \"q\" followed by return to quit" function... (6 Replies)
Discussion started by: JamieMurry
6 Replies

7. Shell Programming and Scripting

sed magic

I want to become an expert @ using sed, but i do not have enough time... Atm I have a repository in my apt/sources.list but it is commented out since i do not want to install packages from it (backtrack repository) except the exploitdb package. I would like make a command, lets say... (5 Replies)
Discussion started by: redsolja
5 Replies

8. What is on Your Mind?

I got a magic wand

My new magic wand just came. It looks great. Looking at it, it looks like it is carved by hand from a solid piece of wood. It could easily serve as a prop in a Harry Potter film. But it is actually a high tech appliance. A built-in accelerometer can detect how you are moving the wand. ... (2 Replies)
Discussion started by: Perderabo
2 Replies

9. Shell Programming and Scripting

sed magic

Hello all, I have an inherited an old ugly script I'm trying to clean up a bit. What I am currently working on is a line like the following: Complication=" and ta.secID = 011222 and upper(ta.proc_ctrl_no) != 'IMPACT'";; I just want to combine a search for lines that begin with... (5 Replies)
Discussion started by: blip42
5 Replies
FTP_NB_GET(3)								 1							     FTP_NB_GET(3)

ftp_nb_get - Retrieves a file from the FTP server and writes it to a local file (non-blocking)

SYNOPSIS
int ftp_nb_get (resource $ftp_stream, string $local_file, string $remote_file, int $mode, [int $resumepos]) DESCRIPTION
ftp_nb_get(3) retrieves a remote file from the FTP server, and saves it into a local file. The difference between this function and ftp_get(3) is that this function retrieves the file asynchronously, so your program can perform other operations while the file is being downloaded. PARAMETERS
o $ftp_stream - The link identifier of the FTP connection. o $local_file - The local file path (will be overwritten if the file already exists). o $remote_file - The remote file path. o $mode - The transfer mode. Must be either FTP_ASCII or FTP_BINARY. o $resumepos -The position in the remote file to start downloading from. RETURN VALUES
Returns FTP_FAILED or FTP_FINISHED or FTP_MOREDATA. EXAMPLES
Example #1 ftp_nb_get(3) example <?php // Initate the download $ret = ftp_nb_get($my_connection, "test", "README", FTP_BINARY); while ($ret == FTP_MOREDATA) { // Do whatever you want echo "."; // Continue downloading... $ret = ftp_nb_continue($my_connection); } if ($ret != FTP_FINISHED) { echo "There was an error downloading the file..."; exit(1); } ?> Example #2 Resuming a download with ftp_nb_get(3) <?php // Initate $ret = ftp_nb_get($my_connection, "test", "README", FTP_BINARY, filesize("test")); // OR: $ret = ftp_nb_get($my_connection, "test", "README", // FTP_BINARY, FTP_AUTORESUME); while ($ret == FTP_MOREDATA) { // Do whatever you want echo "."; // Continue downloading... $ret = ftp_nb_continue($my_connection); } if ($ret != FTP_FINISHED) { echo "There was an error downloading the file..."; exit(1); } ?> Example #3 Resuming a download at position 100 to a new file with ftp_nb_get(3) <?php // Disable Autoseek ftp_set_option($my_connection, FTP_AUTOSEEK, false); // Initiate $ret = ftp_nb_get($my_connection, "newfile", "README", FTP_BINARY, 100); while ($ret == FTP_MOREDATA) { /* ... */ // Continue downloading... $ret = ftp_nb_continue($my_connection); } ?> In the example above, newfile is 100 bytes smaller than README on the FTP server because we started reading at offset 100. If we didn't disable FTP_AUTOSEEK, the first 100 bytes of newfile would be ''. SEE ALSO
ftp_nb_fget(3), ftp_nb_continue(3), ftp_fget(3), ftp_get(3). PHP Documentation Group FTP_NB_GET(3)
All times are GMT -4. The time now is 10:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy