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
pico(1) 						      General Commands Manual							   pico(1)

Name
       pico - simple text editor in the style of the Pine Composer

Syntax
       pico [-f] [+n] [-nn] [-t] [-v] [-w] [-z] [file]

Description
       Pico is a simple, display-oriented text editor based on the Pine message system composer.  As with Pine, commands are displayed at the bot-
       tom of the screen, and context-sensitive help is provided.  As characters are typed they are immediately inserted into the  text.   Editing
       commands are entered using control-key combinations.  As a work-around for communications programs that swallow certain control characters,
       you can emulate a control key by pressing ESCAPE twice, followed by the desired control character, e.g. "ESC ESC c" would be equivalent	to
       entering a ctrl-c.  The editor has five basic features: paragraph justification, searching, block cut/paste, a spelling checker, and a file
       browser.

       Paragraph justification (or filling) takes place in the paragraph that contains the cursor, or, if the cursor  is  between  lines,  in  the
       paragraph  immediately  below.  Paragraphs are delimited by blank lines, or by lines beginning with a space or tab.  Unjustification can be
       done immediately after justification using the control-U key combination.

       String searches are not sensitive to case.  A search begins at the current cursor position and wraps around the end of the text.  The  most
       recent search string is offered as the default in subsequent searches.

       Blocks  of  text  can be moved, copied or deleted with creative use of the command for mark (ctrl-underscore), delete (ctrl-k) and undelete
       (ctrl-u).  The delete command will remove text between the "mark" and the current cursor position, and place it in the "cut"  buffer.   The
       undelete command effects a "paste" at the current cursor position.

       The  spell  checker  examines all words in the text.  It then offers, in turn, each misspelled word for correction while highlighting it in
       the text.  Spell checking can be cancelled at any time.	Alternatively, pico will substitute for the default spell checking routine a  rou-
       tine defined by the SPELL environment variable.	The replacement routine should read standard input and write standard output.

       The  file browser is offered as an option in the "Read File" and "Write Out" command prompts.  It is intended to help in searching for spe-
       cific files and navigating directory hierarchies.  Filenames with sizes and names of directories in the current working directory are  pre-
       sented for selection.  The current working directory is displayed on the top line of the display while the list of available commands takes
       up the bottom two.  Several basic file manipulation functions are supported:  file renaming, copying, and deletion.

       More specific help is available in pico's online help.

Options
       -f     Use function keys for commands.  This option supported only in conjunction with UW Enhanced NCSA telnet.

       +n     Causes pico to be started with the cursor located n lines into the file. (Note: no space between "+" sign and number)

       -nn    The -nn option enables new mail notification.  The n argument is optional, and specifies how often,  in  seconds,  your  mailbox	is
	      checked  for new mail.  For example, -n60 causes pico to check for new mail once every minute.  The default interval is 180 seconds,
	      while the minimum allowed is 30. (Note: no space between "n" and the number)

       -t     Enable "tool" mode.  Intended for when pico is used as the editor within other tools (e.g., Elm, Pnews).	Pico will not  prompt  for
	      save on exit, and will not rename the buffer during the "Write Out" command.

       -v     View the file only, disallowing any editing.

       -w     Disable word wrap (thus allow editing of long lines).

       -z     Enable ^Z suspension of pico.

       Lastly,	when  a running pico is disconnected (i.e., receives a SIGHUP), pico will save the current work if needed before exiting.  Work is
       saved under the current filename with ".save" appended.	If the current work is unnamed, it is saved under the filename "pico.save".

Bugs
       The manner in which lines longer than the display width are dealt is not immediately obvious.  Lines that continue beyond the edge  of  the
       display are indicated by a '$' character at the end of the line.  Long lines are scrolled horizontally as the cursor moves through them.

Files
       pico.save	Unnamed interrupted work saved here.
       *.save		Interrupted work on a named file is saved here.

Authors
       Michael Seibel, mikes@cac.washington.edu
       Laurence Lundblade, lgl@cac.washington.edu
       Pico was originally derived from MicroEmacs 3.6, by Dave G. Conroy.
       Pico is a trademark of the University of Washington.
       Copyright 1989-1994 by the University of Washington.

See Also
       pine(1)
       Source distribution (part of the Pine Message System):
	  ftp://ftp.cac.washington.edu/mail/pine.tar.Z

								    Version 2.4 							   pico(1)
All times are GMT -4. The time now is 10:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy