Linux :r (Retrieve) Operator


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Linux :r (Retrieve) Operator
# 1  
Old 02-17-2010
Network Linux :r (Retrieve) Operator

Hi.
New to Linux shell scripting.
Scenario:
1). Using "vi" I created a shell script named practivity. I press Esc to switch to command mode.
2). After that the instructions say "to retrieve the 3 script files, type :r pact, press Enter, :r pnumname, press Enter; :r joinall, Enter.
I followed those command
3). Now I have to delete 9 lines (9dd), and that is where the problem starts.

I can't enter any commands. I pressed Esc to put me in COMMAND mode, but nothing happens.
Anyone has and ideas?
Thanks In Advance
# 2  
Old 02-17-2010
Don't know why ESC isn't putting you into command mode. Maybe there's problems with your keymap. ':r' isn't a linux thing, it's a vi thing, by the way. Don't try and pin the blame for vi on us. ;p

Check if the 'nano' editor is available.
# 3  
Old 02-17-2010
Thanks for responding, Corona688.
It was my keyboard. I have an iMac keyboard, & if I don't press the keys down hard, I do not get good results.
Thanks again
P.S. What's 'nano' ed. & how do I check for it? I'm using Fedora (if that makes a diff.).
OK vi is innocent. (smile)
# 4  
Old 02-17-2010
It's a friendlier text editor that uses hotkeys instead of unguessable magic sequences. Shockingly, it actually tells you what keys the hotkeys are. Try running 'nano'. if it works, you have it. if it doesn't, you don't.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Linux Platform - NDM Script - && Operator

Hi All, I have a requirement where i need to NDM 3 files from LINUX to Mainframe system & trigger a job in mainframe once the 3 files are transmitted successfully. I am getting an error message in the && operator (the code component where i am checking whether step 1/2/3 are completed). ... (2 Replies)
Discussion started by: dsfreddie
2 Replies

2. UNIX for Dummies Questions & Answers

Unary Operator Message - Linux/Unix

I have this code to check the largest files by bytes. Whenever I run it, I keep getting an error message "unary operator expected" for i in * do if set -- $(ls -ls "$i") alias filesize='ls -lS' then echo $1: $5 bytes fi done (1 Reply)
Discussion started by: kxb
1 Replies

3. UNIX for Dummies Questions & Answers

+= operator

im new to bash scripting and im just using online tutorials and trial and error. i wanted to write a script to read numbers from a file and find their sum: #!/bin/bash theSum=0 for line in $(cat numbers.txt) do let "theSum = theSum + $line" echo "$line" done echo "The sum is... (3 Replies)
Discussion started by: astrolux444
3 Replies

4. Shell Programming and Scripting

equal to operator

Hi, I have the below script executed arg="dir" if "$arg" = "dir" then echo "true" else echo "false" fi Please let me know what happens in the if command. My output is: dir: dir: No such file or directory false which is not the desired output. When i used test command... (1 Reply)
Discussion started by: anijan
1 Replies

5. UNIX for Dummies Questions & Answers

su with << operator

All, THe below is my script , when i use this i am getting nothing . could any one help me to know what is the use of the << operator below su - $8 << supo echo "exportsph $2 $1 $3 $4" exportsph $2 $1 $3 $4 supo i also tried as individual command su - userid << supo , when i do... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies

6. Programming

new operator

Hi, Please clear the 2 questions, 2 Questions, 1) Why the new as a operator? Is there any special reason why it can't be a function like malloc? 2) How are we considering sizeof(),new are as a opearartors? I know + - * / -> , . etc.. are operators, which criteria satisfied by sizeof()... (4 Replies)
Discussion started by: Nagapandi
4 Replies

7. Shell Programming and Scripting

SED * operator

1. echo "abc 123 abc" | sed 's/*/X/' yields - X 123 abc Does this mean the "*" operator matches ONLY the first and the entire token - "abc" and replaces with "X" ? 2. echo "123 abc" | sed 's/*/X/' yields - X123 abc What does this indicate about the "*" operator ?? (7 Replies)
Discussion started by: sinpeak
7 Replies

8. Shell Programming and Scripting

Help need: new line operator :

We are calling Unix through SQR. I want to know there is any operator available in Unix ...so that the remaining command should go to the next line I will explain , find the below code . It is in single line which is coded as single variable in SQR and called using 'call system using '... (3 Replies)
Discussion started by: satyam_sat
3 Replies

9. HP-UX

Or operator with if

hi, i was trying to club to test condition with if. if -o ; then it is giving me error message, i wanted to ask how can we check two condtions with one if. (1 Reply)
Discussion started by: babom
1 Replies

10. Shell Programming and Scripting

And operator

I am trying to check two variables and if both are blank I want to set a flag: the_f3_pid=`rsh $target ps -ef | grep "f3.eab" | awk '{print $2}'` the_f7_pid=`rsh $target ps -ef | grep "f7.eab" | awk '{print $2}'` if ; then y=1 fi I get an error: ./script_name: test: 0403-021 ]... (4 Replies)
Discussion started by: rcarnesiii
4 Replies
Login or Register to Ask a Question