Sponsored Content
Full Discussion: move to a particular line
Top Forums Shell Programming and Scripting move to a particular line Post 302363279 by ghostdog74 on Tuesday 20th of October 2009 12:57:35 AM
Old 10-20-2009
if your "positions" are by space delimited fields, with bash
Code:
#!/bin/bash
i=1
while read -r a b c d e f g h
do
 if [ "$i" -eq 15 ];then 
    echo "$g"
 fi 
 i=$((i+1))
done < file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to move the line after a certain pattern in the file

Hi, I have a file called /bb/bin/rstrt. I need to move the line/entry "ccpm_load_shared_memory" after the entry "initcorp". The problem is that there are several entries for "initcorp" in this file and I need the entry to be moved only after the first instance of "initcorp" Is there a way... (5 Replies)
Discussion started by: aoussenko
5 Replies

2. Shell Programming and Scripting

Move a line to end of file

Can somebody help me with a script .... Read a file /etc/inittab find the string starting with rcml and move it entirely towards the end of file. rcml:2:once:/usr/sni/aix52/rc.ml > /dev/console 2>&1 I basically want to change the startup sequence. (2 Replies)
Discussion started by: imanuk2007
2 Replies

3. Shell Programming and Scripting

move to a particular position and line

Hi, How can i move to particular line and to a particular position in a file using unix commands ? eg: in the line 30 and position 10 i want to print my name in a file. Cheers, Mohan (1 Reply)
Discussion started by: mohanpadamata
1 Replies

4. Shell Programming and Scripting

Use sed to move last line to top

I have parsed a curl download with sed commands. I would also like to move the last line in the output file to the top. Can I use sed for this? (3 Replies)
Discussion started by: jostber
3 Replies

5. Shell Programming and Scripting

move datestamp to beginning of line where available

My current output is as follows: All Day Event Someone's Birthday Class 7:00 PM Pick up dry cleaning 1:00 PM Wake up 8:00 AM I'd like the output to remain the same but have the times moved to the beginning of the line with a hyphen after it so it would look like, All Day Event... (3 Replies)
Discussion started by: chrish
3 Replies

6. Shell Programming and Scripting

awk script to move a line after the matched pattern line

I have the following text format in a file which lists the question first and then 5 choices after that the explanantion and finally the answer. 1.The amount of time it takes for most of a worker’s occupational knowledge and skills to become obsolete has been declining because of the... (2 Replies)
Discussion started by: nanchil_guy
2 Replies

7. Shell Programming and Scripting

Move lines above a line onto one line

So say I have the file: john london 24 male ======== jane london 22 female ======== mike 23 ======== Bob how do i get the information i need on one line as such: (5 Replies)
Discussion started by: linuxkid
5 Replies

8. UNIX for Dummies Questions & Answers

How move characters following a semicolon to a new line

Hello, I was wondering how I can move this: ABC;>12 BLA;>67 DEF;>22 into this ABC >12 BLA >67 DEF >22 thanks for your help. (1 Reply)
Discussion started by: blakers
1 Replies

9. Shell Programming and Scripting

Need a help to move control to another line in my script

I have menu option in my script and in that i have 4 options like below :- echo "Please select a target server .." echo " AIX - AIX1" echo " AIX - AIX2" echo " AIX - AIX3" echo " HP-UX - HP-UX1" echo "Enter your menu choice : \n" read tgtser ... (8 Replies)
Discussion started by: Renjesh
8 Replies

10. Shell Programming and Scripting

Move a line to top of the file

Hi, I have a following file and it has only one occurrence of line that says "Output view:". It could be in middle somewhere ( i don't know the exact location ). I want to move it as the first line of the file. Input AAA BBBB CCCC Output view: XXXX YYYY ZZZZ Output should be: Output... (13 Replies)
Discussion started by: jakSun8
13 Replies
VM(1)								      mgetty								     VM(1)

NAME
vm - VoiceModem is the program for handling the voice modem functionality from shell scripts ACTIONS
beep options [<frequency [<length in 0.001sec>]]> diagnostics options device name (e.g. ttyS2 dial options phone number help play options [<file names]+> record options file name shell options [<shell script [shell options]]> wait options [<time in seconds]> devicetest OPTIONS
-c n use compression type n -d n set i/o device -t, -m, -i, -e, -s, -H equals to -d <2,3,4,5,6,7> -l s set device string (e.g. -l ttyS2:ttyC0) -v verbose output -w use off / on hook signal from local handset to start and stop recording -x n set debug level -L n set maximum recording length in sec -P print first DTMF tone on stdout and exit -R read and print DTMF string on stdout and exit -S s set default shell for shell scripts (e.g. -S /bin/sh) -T n set silence timeout in 0.1sec -V n set silence threshold to <n> (0-100%%) SEE ALSO
vgetty(1) POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 30: You forgot a '=back' before '=head1' Around line 32: '=item' outside of any '=over' Around line 71: You forgot a '=back' before '=head1' perl v5.10.1 2010-04-04 VM(1)
All times are GMT -4. The time now is 04:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy