Outline ·
[ Standard ] ·
Linear+
shell script, simple script
|
TSnxfx
|
Jun 1 2005, 05:11 PM, updated 21y ago
|
|
Ok here im want to do. i have a string and concat/append another string using a loop
the pseudocode
for 1 to 3 str1 = str1 + "A" end for
The result would be "AAA"
any idea on how to do this using unix korn shell script any idea is much appreciated
This post has been edited by nxfx: Jun 1 2005, 05:32 PM
|
|
|
|
|
|
nameless
|
Jun 1 2005, 07:32 PM
|
|
CODE #!/bin/bash string="" for (( i = 0; i < 3; i++ )) do string=$string"A" done echo $string
There too many online Unix shell Scripting Tutorial, try Google around.
|
|
|
|
|
|
kons
|
Jun 1 2005, 08:43 PM
|
Конс
|
QUOTE("nameless") There too many online Unix shell Scripting Tutorial, try Google around. Seems like bourne again shell to me... the for loop in korn shell isn't like that... as far as I can remember.
|
|
|
|
|
|
TSnxfx
|
Jun 2 2005, 01:08 PM
|
|
sokay.. figured it out. thanx anyway.
|
|
|
|
|