Sponsored Content
Full Discussion: Insert text below other text
Top Forums Shell Programming and Scripting Insert text below other text Post 302346525 by bobbasystem on Saturday 22nd of August 2009 05:41:10 PM
Old 08-22-2009
Quote:
Originally Posted by Leo Gutierrez
Suponiendo que "file.txt" tiene el siguiente contenido:
Code:
leo@lein:~/Escritorio$ cat "file.txt"
<select name="RecPerPage" id="RecPerPage" onchange="this.form.submit();" class="phpmaker">
<option value="50">Select version</option>
</select>
leo@lein:~/Escritorio$

Y tengo un script "shell.sh" con el siguiente contenido:
Code:
#!/usr/bin/bash
cat file.txt | sed '/option value/ a\
<option value="anything">Select version1</option>'

Ahora ejecutandolo:
Code:
leo@lein:~/Escritorio$ bash shell.sh
<select name="RecPerPage" id="RecPerPage" onchange="this.form.submit();" class="phpmaker">
<option value="50">Select version</option>
<option value="anything">Select version1</option>
</select>
leo@lein:~/Escritorio$

Solo redirigelo:
Code:
leo@lein:~/Escritorio$ bash shell.sh > nuevo.txt
leo@lein:~/Escritorio$ cat nuevo.txt 
<select name="RecPerPage" id="RecPerPage" onchange="this.form.submit();" class="phpmaker">
<option value="50">Select version</option>
<option value="anything">Select version1</option>
</select>
leo@lein:~/Escritorio$

Saludos.
O solo:
Code:
sed '/option value/ a\<option value="anything">Select version1</option>' "file.txt"

Thanks Leo!! Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

insert text into column

Hello! I have a text file containing some text : : : bla other text : : : bla any text : : : bla containing 3 columns separated by the ':' sign. Now i want to insert 'this' in the 2nd line after the 2nd column-deliminiter (i.e. into 3rd column), like some text : : : bla other text :... (1 Reply)
Discussion started by: knoxo
1 Replies

2. Shell Programming and Scripting

How to insert some constant text at beginig of each line within a text file.

Dear Folks :), I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp. I can do this in vi editor by using this command :g/^/s//BBB_ e,g I have a file named as Test.dat and it containins below text: michal... (4 Replies)
Discussion started by: Muhammad Afzal
4 Replies

3. Shell Programming and Scripting

Need to insert new text and change existing text in a file using SED

Hi all, I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output. sed '$a\ hi... ' shell > shell1 But I face problem when using the same in script. It is throwing the error as, sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

4. Shell Programming and Scripting

Insert Text On file

Hi All, Can someone pls help me to insert some text on a file. my file contains something like below.. AKBULBU, BALUMIL, BATCH,BATCH BOARROB, BOTAKAT, C57896, CAKIOZE, CHECMER, CICOFRA, CISZPAW,2194485 I want output as USER_ID, LOGIN_ID (6 Replies)
Discussion started by: harshakusam
6 Replies

5. Shell Programming and Scripting

Again: Insert text below other text

I need help with this please: I have this text: <li><a href="login.php">Ingresar</a> and I need insert this text below: <li><a href="http://localhost/dummysila/">anything<a></li> help please! Note: all this with bash....command sed I think.... (1 Reply)
Discussion started by: bobbasystem
1 Replies

6. Shell Programming and Scripting

How to insert text after a block of text?

Input: fstab is a configuration file that contains information of all the partitions and storage devices in your computer. The file is located under /etc, so the full path to this file is /etc/fstab. The >>>>> characters would be replaced by some texts. For example if i run a... (5 Replies)
Discussion started by: cola
5 Replies

7. Shell Programming and Scripting

Insert text using sed

sed 's/$/TEST/g' will insert TEST at the end of each line. i want to insert TEST at column 64 (7 Replies)
Discussion started by: lawsongeek
7 Replies

8. Shell Programming and Scripting

Insert value to db from text file

Hi, I have a single value in insertval file. I want to load that value to database with the current date. I tried the below code but it is inserting <NULL> to database and echo $c is also null. cat insertval | awk -F ' ' '{print $1}' > c echo c=$c data=`sqlplus -s user/pwd@hostname <<EOF ... (5 Replies)
Discussion started by: Neethu
5 Replies

9. Shell Programming and Scripting

Insert text before first 'n' lines

I want to put a particular text, say, the hash '#' before each of the first n lines of a file. How can I do that? (4 Replies)
Discussion started by: hbar
4 Replies

10. Shell Programming and Scripting

How to insert text within a file?

Hi, I am trying to check for missing dates in a file and would want to insert the missing date into the file. Currently the script is as below #!/bin/ksh dates="dates" cat ${dates} | grep -v "^#" curr_month=`date '+%m` curr_day=`date '+%d` curr_year=`date '+%Y` #curr_month=02... (7 Replies)
Discussion started by: newbie_01
7 Replies
sane-leo(5)							File Formats Manual						       sane-leo(5)

NAME
sane-leo - SANE backend for LEO Technologies scanners DESCRIPTION
The sane-leo library implements a SANE (Scanner Access Now Easy) backend that provides access to some LEO SCSI flatbed scanners. This back- end should be considered beta-quality software! LEO scanners were also sold under the Across Technologies brand. The scanners that should work with this backend are: Vendor Model status ---------------------- ----------- Across FS-1130 tested Leo S3 tested The options the backend supports can either be selected through command line options to programs like scanimage or through GUI elements in xscanimage or xsane. If you have any strange behavior, please report to the backend maintainer or to the SANE mailing list. Valid command line options and their syntax can be listed by using scanimage --help -d leo Scan Mode --mode selects the basic mode of operation of the scanner valid choices are Black & White , Grayscale and Color The Black & White mode is black and white only (1 bit). Grayscale will produce 256 levels of gray (8 bits). Color will produce a 24 bits color image. --resolution selects the resolution for a scan. The scanner can do all resolutions between 1 and 300, in increments of 1. Geometry options -l -t -x -y control the scan area: -l sets the top left x coordinate, -t the top left y coordinate, -x selects the width and -y the height of the scan area. All parameters are specified in millimeters by default. Enhancement options --custom-gamma (grayscale and color mode only) allows the user to specify a gamma table (see the next 3 parameters). --red-gamma-table (color mode only) can be used to download a user defined gamma table for the red channel. The table must be 256 bytes long. --green-gamma-table (color mode only) can be used to download a user defined gamma table for the green channel. The table must be 256 bytes long. --blue-gamma-table (color mode only) can be used to download a user defined gamma table for the blue channel. The table must be 256 bytes long. --halftone (Black & White only) select the halftone mask to use. Possible values are Diamond , 8x8 Coarse Fatting , 8x8 Fine Fatting , 8x8 Bayer and 8x8 Vertical Line --preview requests a preview scan. The resolution used for that scan is 28 dpi and the scan area is the maximum allowed. The scan mode is user selected. The default is "no". CONFIGURATION FILE
The configuration file /etc/sane.d/leo.conf supports only one information: the device name to use (eg /dev/scanner). FILES
/usr/lib/sane/libsane-leo.a The static library implementing this backend. /usr/lib/sane/libsane-leo.so The shared library implementing this backend (present on systems that support dynamic loading). ENVIRONMENT
SANE_DEBUG_LEO If the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. E.g., a value of 128 requests all debug output to be printed. Smaller levels reduce verbosity. LIMITATIONS
The windows TWAIN driver has many more options than this SANE backend. However they are only software adjustments. This backend only imple- ments what the scanner can support. BUGS
None known. SEE ALSO
sane-scsi(5), scanimage(1), xscanimage(1), xsane(1), sane(7) AUTHOR
The package is actively maintained by Frank Zago. http://fz.eryx.net/sane/#leo 16 April 2002 sane-leo(5)
All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy