The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Development Releases: Linux Mint 4.0 Beta "Fluxbox", 4.0 Alpha "Debian" iBot UNIX and Linux RSS News 0 01-04-2008 03:00 PM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
how to "remsh" from a Unix machine to a Linux or SunOS elthox UNIX for Dummies Questions & Answers 2 10-09-2007 10:22 PM
Avoid "++ requires lvalue" Error in Loop Calculation sandeepb Shell Programming and Scripting 3 09-24-2007 08:02 AM
How to combine "find" command in for each loop (tcsh) umen Shell Programming and Scripting 3 08-22-2005 05:07 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-05-2006
alantang alantang is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 1
remsh newhost "for loop"

Hi,

In ksh how can I execute something like this:

remsh newhost "for i in 1 2 3 4 5 do echo file$i; cat file$i; done"

I cannot pass the contrl J or enter in th above line which is required by the for loop.

Thanks...
  #2 (permalink)  
Old 11-05-2006
nathan nathan is offline VIP Member  
Supporter
  
 

Join Date: Jul 2006
Posts: 156

Code:
remsh newhost "for i in 1 2 3 4 5 ; do echo file$i; cat file$i; done"

The ^J character is not required for the 'for' loop. Note the semicolon I have inserted between the '5' and the 'do' part of your statement.

You could insert the ^J character, though. First, do a "set -o vi", to use 'vi' style command editing. ( I recommend some familiarity with 'vi' before you do this. ) Then, in your command, press <ctrl>+v , <ctrl> + j . That should insert the newline character.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0