Sponsored Content
Top Forums Shell Programming and Scripting place cursor in specific coordinates Post 302502832 by lechelle on Wednesday 9th of March 2011 03:11:22 AM
Old 03-09-2011
place cursor in specific coordinates

Hi,
I have this problem on how to place the cursor in a text editor (for example: pico).

I made this script that would attach comments to a script file then open the script file,
I would like to know how to place the cursor in a specific place,
for example at the end of the comments,

here's part of the script:
Code:
echo " " > $sname
echo " " >> $sname
echo "#=================================================" >> $sname
echo "# $sname" >> $sname
echo "# $author" >> $sname
echo "# $date" >> $sname
echo "#=================================================" >> $sname
pico $sname		
#after this, I don't know how to place the cursor

maybe something that could also work for Vi and Emacs

thank you Smilie

Last edited by Franklin52; 03-09-2011 at 04:30 AM.. Reason: Please use code tags, thank you
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

insert file 1 at a specific place of file 2

Hello, I need to search in file2 for class A : public B { and insert right after that the content of file1. I am a bit lost as to which tools (which bash functions, awk...). I should use. Thanks for some directions here. Regards (1 Reply)
Discussion started by: JCR
1 Replies

2. Shell Programming and Scripting

Splitting av file in 2 at specific place based on textpattern

I have a file that I want to split in 2 (with Bourne shell sh) preferably. The file consists of groups of lines separated by newline. The file can vary in length, so I need to check number of groups of text. Here's an example ====EXAMPLE START==== #fruit banana #color yellow #surface smooth... (0 Replies)
Discussion started by: borgeh
0 Replies

3. Shell Programming and Scripting

Jump to a specific place in a file?

If I cat a file And want to go to the first instance of a particular value - what command would I use? And then from that point where I jumped to search for another value - but only search from that point forward not before the file? Thanks~ (2 Replies)
Discussion started by: llsmr777
2 Replies

4. Shell Programming and Scripting

Read from file specific place in file using inode

Hello, I am using tcsh on AIX. I would like to write a script that does the following: 1. given an inode, how do I find exactly the name of the file? I know I could do this using ls -i | grep <inode> but it returns: <inode> <filename>. I need some string manipulation or something to... (1 Reply)
Discussion started by: lastZenMaster
1 Replies

5. Shell Programming and Scripting

script for inserting line at specific place in file

I use zentyal for my server admin, which is great but zentyal auto-generates config file on boot and hence overwrites any changes made directly to config files. In order to allow multiple user access to a MS ACCESS database, I need to customise the smb.conf file and add the following line to the... (9 Replies)
Discussion started by: barrydocks
9 Replies

6. UNIX and Linux Applications

Passing the value of a cursor to another cursor

i have 2 cursors. i want to assign the value of first cursor(employee_id) to the where condition of cursor c2(please refer the bold statement). how do i do if i want to assign the value of c1 to where condition of cursor c2? declare cursor c1 IS select employee_id from employee cursor c2... (1 Reply)
Discussion started by: vkca
1 Replies

7. Shell Programming and Scripting

How to merge variable data from another file into specific place?

Hello, I'm trying to create multiple commands using a variable input from another file but am not getting any successful results. Basically, file1.txt contains multiple lines with single words: <file1.txt> yellow blue black white I want to create multiple echo commands with these... (8 Replies)
Discussion started by: demmel
8 Replies

8. UNIX for Advanced & Expert Users

Replace certain character at specific place with related character

hello i have file with 100k records and each one has certain value that starts at 28th column and certain value that starts at 88th column e.g. 1st file <25>1234567 ..... <88> 8573785485 i have aditional file with values which are related to value that starts at 88th column of the... (1 Reply)
Discussion started by: dell1520
1 Replies

9. Shell Programming and Scripting

Unable to get the Specific column with 2 decimal place

Hi, I have an issue converting decimal places of a particular column, i am using below script to get the output, but the output is not generating in desired format. awk -F"," 'BEGIN{OFS=","}{if(NR==0)getline;if ($7 != "") {if ($7 > 0) $7=$7/100 ; {printf "%.2f"... (3 Replies)
Discussion started by: rramkrishnas
3 Replies

10. Shell Programming and Scripting

awk to place specific contents filename within text file

I am trying to use awk to place the contens of a filename in $1 and $2 followed by the data in the text file. Basically, put the filename within the text file. There are over 1000 files in the directory and as of now each file is saved with a unique name but it is not within the file. Thank you... (10 Replies)
Discussion started by: cmccabe
10 Replies
META(3) 						     Library Functions Manual							   META(3)

NAME
libmeta.a - simplified interface to metafile(5) SYNOPSIS
extern FILE *pout; mline(x, y, type, thick, color) mpoly(x, y, border, pat, color) mdraw(x, y) mtext(x, y, s, cpi, color) char *s; mvstr(xmin, ymin, xmax, ymax, s, d, thick, color) char *s; mrectangle(xmin, ymin, xmax, ymax, pat, color) mtriangle(xmin, ymin, xmax, ymax, d, pat, color) msegment(xmin, ymin, xmax, ymax, sname, d, thick, color) char *sname; msetpat(pat, pattern) char *pattern; mopenseg(sname) char *sname; mcloseseg() minclude(fname) char *fname; mendpage() mdone() DESCRIPTION
The routines in libmeta provide a simple interface to the metafile(5) 2D graphics stream. Output from these routines is sent to pout. Pout defaults to the standard output, and should be piped to the appropriate device driver. All coordinates range from 0 to 16383 and map to a square area on the output device. D values are one of 'r', 'u', 'l' and 'd' correspond- ing to right, up, left, and down respectively. Color values range from 0 to 3 and normally correspond to black, cyan, green and blue. Pattern values range from 0 to 3 and default to solid, thick lines, thin lines, and candystripe. Pattern value mapping may be changed via setpat. All strings are null-terminated, and do not contain newlines. Mline starts a line at the given coordinates. The line type is a number from 0 to 3 corresponding to solid, dashed, dotted, and dot- dashed. The line thickness, thick, is a number from 0 to 3. Connected lines are drawn with successive calls to mdraw. Mpoly starts a polygon at the given coordinates. The boolean border specifies whether or not a border is desired around the polygon. Mdraw is used to add vertices to the polygon. The polygon will be closed automatically after the last call. Mtext prints a string of hardware characters starting at the given coordinates. The characters per inch are cpi. Text is always oriented to the right. Mvstr places a vector character string within the given boundaries. The string is oriented according to d. The character line thickness is given by thick. Mrectangle fills the given box with pat. Mtriangle fills the half-box with orientation d in the given boundaries. Right corresponds to a triangle in the lower right half of the box. Up corresponds to a triangle in the upper right, left is upper left, and down is lower left. Msegment places an instance of the segment sname within the given boundaries. The segment is oriented according to d, where 'r' is null rotation. If either thick or color is nonzero, its value will replace corresponding values in the segment primitives. (For area filling, thick changes the fill pattern.) Msetpat maps pat to pattern. Pattern is a string of the form "Pn" where n is a number between 0 and 11. Mopenseg opens the segment named sname. All graphics calls up to a matching call to mcloseseg are stored under sname. An instance of the segment is obtained with a call to msegment. Segments can be nested to any level, and redefining segments is allowed. Beware of calls to mtext within a segment, since text will not rotate or scale. Minclude includes the graphics metafile fname in the output stream. Mendpage advances to the next screen or page. On a terminal, the bell rings and a line is read to prevent premature erasure. Mdone completes metafile output, and is the only required call. DIAGNOSTICS
None. SEE ALSO
t4014(1), mx80(1), impress(1), primout(3), metafile(5) Radiance 11/15/93 META(3)
All times are GMT -4. The time now is 09:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy