10-08-2008
/usr/bin/ex - "$targfile" << _EOF_ 1>/dev/null 2>&1
${linenum_below}i
$source
.
wq!
_EOF_
if [[ $? -ne 0 ]]; then
# add error log here
fi
10 More Discussions You Might Find Interesting
1. Programming
I have a problem that I want to insert and delete some chars in the middle of a file. fopen() and fdopen() just allow to append at the end.
Is there any simple method or existing library that allow these actions? Thanks in advance.:confused: (7 Replies)
Discussion started by: ivancheung
7 Replies
2. Shell Programming and Scripting
I'm trying to insert a single character at position 11 in everyline of a file.
My input file looks like this:
456781 ~Y~12345
456782 ~N~12300
and I want my output to look like this:
45678~1 ~Y~12345
45678~2 ~N~12300
I tried the following awk code, but it's not working:... (3 Replies)
Discussion started by: mmarino
3 Replies
3. Shell Programming and Scripting
how do u insert text into a specific place in a file, say the middle for example, without changing the name for that file (1 Reply)
Discussion started by: mopimp
1 Replies
4. Shell Programming and Scripting
Script 1
Pre-requisites
Create a file with x amount of lines in it, the content of your choice.
Write a script that takes two arguments. The first being a line of text, the second being your newly created file. The script should take the first argument and insert it into the very top (the... (3 Replies)
Discussion started by: ali hussain
3 Replies
5. Shell Programming and Scripting
I wrote a script like
#!/bin/bash
echo $1 > temp
cat $2 >> temp
mv temp $2
now I have problem appending the above script(only using bash shell) so that it now inserts the first argument into the middle of the file.
I have tried using $(('wc -l < file' / 2 ))
but invain so could any one... (4 Replies)
Discussion started by: boris
4 Replies
6. Shell Programming and Scripting
how to insert one file into another file not by concatenating as usual done.
file1
A B
C D
E F
G H
I J
K L
file2
23455
33444
33334
33345
Output shud be
23455
A B
C D (4 Replies)
Discussion started by: cdfd123
4 Replies
7. Shell Programming and Scripting
I want to insert a text into the middle of a file (3 Replies)
Discussion started by: relle
3 Replies
8. UNIX for Dummies Questions & Answers
Hey guys, how do we take a line of text as an argument from a user and then insert it in the middle of a file irrespective of the number of lines in the file. I am trying to do this without SED or AWK. Inserting it in the beginning and at the end is easy, but i am trying to accomplish inserting... (6 Replies)
Discussion started by: kartikkumar84@g
6 Replies
9. Shell Programming and Scripting
Hi,
So far i've made a script that takes two argument, 1st is the contents and the 2nd is the named file. At the moment i've managed to insert new contents as a new line at the top, but i want to ask how can you insert contents in the middle of the file?
Source Code
#!/bin/bash
#Write... (3 Replies)
Discussion started by: zen10
3 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies
UUPOLL(8) System Manager's Manual UUPOLL(8)
NAME
uupoll - poll a remote UUCP site
SYNOPSIS
uupoll [ -ggrade ] [ -n ] system
DESCRIPTION
Uupoll is used to force a poll of a remote system. It queues a null job for the remote system and then invokes uucico(8).
The following options are available:
-ggrade Only send jobs of grade grade or higher on this call.
-n Queue the null job, but do not invoke uucico.
Uupoll is usually run by cron(5) or by a user who wants to hurry a job along. A typical entry in crontab could be:
0 0,8,16 * * * /usr/bin/uupoll ihnp4
0 4,12,20 * * * /usr/bin/uupoll ucbvax
This will poll ihnp4 at midnight, 0800, and 1600, and ucbvax at 0400, noon, and 2000.
If the local machine is already running uucico every hour and has a limited number of outgoing modems, a more elegant approach might be:
0 0,8,16 * * * /usr/bin/uupoll -n ihnp4
0 4,12,20 * * * /usr/bin/uupoll -n ucbvax
5 * * * * /usr/sbin/uucico -r1
This will queue null jobs for the remote sites at the top of hour; they will be processed by uucico when it runs five minutes later.
FILES
/etc/uucp/ UUCP internal files
/usr/spool/uucp/ Spool directory
SEE ALSO
uucp(1), uux(1), uucico(8)
4.3 Berkeley Distribution October 23, 1996 UUPOLL(8)