10-03-2008
Try out expect
You should do this from Expect, a Tcl extension that is designed to do just what you're asking for.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have observed with print & echo, they produce carriage return <CR> or newline, after they display string next to them.
Is there anyway to avoide these <CR> after the intended string is displayed? (3 Replies)
Discussion started by: videsh77
3 Replies
2. Shell Programming and Scripting
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies
3. UNIX for Dummies Questions & Answers
hi can anyone please tell me the difference between carriage return, linefeed and newline ? (2 Replies)
Discussion started by: streetfi8er
2 Replies
4. Shell Programming and Scripting
Hi
I am using sed command to make SCORE=somevalue to SCORE=blank in a file.
Please see the attached lastline.txt file. After executing the below command on the file, it removes the last line.
cat lastline.txt | sed 's/SCORE=.*$/SCORE=/g' > newfile.txt
Why does sed command remove the... (3 Replies)
Discussion started by: ashok.k
3 Replies
5. Shell Programming and Scripting
Hi,
need your help in below,I have 4 types of file need to be processed so that it will replace carriage return in Remarks column with <:::>
Remarks column position may varies in different types of file.
sample file:
col1|col2|col3|col4|col5|col6|col7|Remarks|col9|col10... (8 Replies)
Discussion started by: agathaeleanor
8 Replies
6. Shell Programming and Scripting
Hey folks,
I've been working on this for some time. Seems simple, but I'm stumped.
I need the following data format:
New_York:Commercial
Geology
Geophysics
Petrophysics
Production_Engineering
Reservoir_Engineering
Pasadena:Commercial
... (5 Replies)
Discussion started by: leepet01
5 Replies
7. Shell Programming and Scripting
Hello,
How do i usecarriage return in ksh.
I want to do an echo "bla bla" and another echo "bla bla" will appear and replace the first echo on screen.
I tried:
until ; do
echo "bla bla \r"
done
please advice.
Thanks. (3 Replies)
Discussion started by: LiorAmitai
3 Replies
8. Shell Programming and Scripting
Hello all,
I've a flat file in the following format:
AB\001\CDED\001\ABC\001\nEG\001\HIJF\001\EFG\001\nHI\003\HIUL\003\HIJ\003
And I want to substitute \n with the carriage return. Any help is appreciated!
Regards,
- Seth (8 Replies)
Discussion started by: sethmj
8 Replies
9. Shell Programming and Scripting
Hi Forum.
I'm running the following awk command to extract the suffix value (pos 38) from the "AM00" record and append to the end of the "AM01" record.
awk 'substr($0,13,4)=="AM00" {SUFFIX = substr($0,38,2)} substr($0,13,4)=="AM01" {$0 = $0 SUFFIX} 1' before.txt > after.txt
Before.txt:... (2 Replies)
Discussion started by: pchang
2 Replies
10. UNIX for Beginners Questions & Answers
Hello,
Can someone please share a Simple AWK command to append Carriage Return & Line Feed to the end of the file, If the Carriage Return & Line Feed does not exist !
Thanks (16 Replies)
Discussion started by: rosebud123
16 Replies
LEARN ABOUT DEBIAN
dislocate
DISLOCATE(1) General Commands Manual DISLOCATE(1)
NAME
Dislocate - disconnect and reconnect processes
SYNOPSIS
dislocate [ program args... ]
INTRODUCTION
Dislocate allows processes to be disconnected and reconnected to the terminal. Possible uses:
o You can disconnect a process from a terminal at work and reconnect from home, to continue working.
o After having your line be dropped due to noise, you can get back to your process without having to restart it from scratch.
o If you have a problem that you would like to show someone, you can set up the scenario at your own terminal, disconnect, walk
down the hall, and reconnect on another terminal.
o If you are in the middle of a great game (or whatever) that does not allow you to save, and someone else kicks you off the ter-
minal, you can disconnect, and reconnect later.
USAGE
When run with no arguments, Dislocate tells you about your disconnected processes and lets you reconnect to one. Otherwise, Dislocate runs
the named program along with any arguments.
By default, ^] is an escape that lets you talk to Dislocate itself. At that point, you can disconnect (by pressing ^D) or suspend Dislo-
cate (by pressing ^Z).
Any Tcl or Expect command is also acceptable at this point. For example, to insert the contents of a the file /etc/motd as if you had
typed it, say:
send -i $out [exec cat /etc/motd]
To send the numbers 1 to 100 in response to the prompt "next #", say:
for {set i 0} {$i<100} {incr i} {
expect -i $in "next #"
send -i $out "$i
"
}
Scripts can also be prepared and sourced in so that you don't have to type them on the spot.
Dislocate is actually just a simple Expect script. Feel free to make it do what you want it to do or just use Expect directly, without
going through Dislocate. Dislocate understands a few special arguments. These should appear before any program name. Each should be sep-
arated by whitespace. If the arguments themselves takes arguments, these should also be separated by whitespace.
The -escape flag sets the escape to whatever follows. The default escape is ^].
CAVEATS
This program was written by the author as an exercise to show that communicating with disconnected processes is easy. There are many fea-
tures that could be added, but that is not the intent of this program.
SEE ALSO
Tcl(3), libexpect(3)
"Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs" by Don Libes, O'Reilly and Associates, January 1995.
AUTHOR
Don Libes, National Institute of Standards and Technology
7 October 1993 DISLOCATE(1)