10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello, I pulled out some old code from an unfinished project the other day and wanted to stream line it better. I know anything beyond a double loop is usually bad practice, and I came up with some logic for later that would no longer require the first loop in the following code that works:
... (5 Replies)
Discussion started by: Azrael
5 Replies
2. Shell Programming and Scripting
Hello,
I have two "for loops" in my script and the second one is not executing the way i want.
Script:
#!/bin/ksh
IFS=' '
printf "Enter Account name: "
read A B C D E F G H I J K L M N O
for i in ${A} ${B} ${C} ${D} ${E} ${F} ${G} ${H} ${I} ${J} ${K} ${L} ${M} ${N} ${O};... (3 Replies)
Discussion started by: seekryts15
3 Replies
3. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
When the code is run only the first loop is utilized and it skips the following when it should move on after the... (2 Replies)
Discussion started by: TwistedKitty
2 Replies
4. Shell Programming and Scripting
KSH isn't my strong suit but it's what my company has to offer. I've got a script with two nested loops, a FOR and UNTIL, and that works fine. When I add a CASE into the mix I end up getting "Unexpected 'done' at line xx" errors. Any suggestions on this?
for divi in at ce ci cm co de di fl... (9 Replies)
Discussion started by: mrice
9 Replies
5. UNIX for Dummies Questions & Answers
Here's the input:
alpha, numeric or alphanumeric string ("line 1 string")
numeric string ("line 2 string")
numeric string ("line 3 string")
numeric string ("line 4 string")
...
where
- each numeric string is in a pattern that can be matched with RE but
- there can be any number of... (2 Replies)
Discussion started by: uiop44
2 Replies
6. Shell Programming and Scripting
You can use one while inside another?
I made the following script (without really knowing if I can use two while) to get 3 numbers different from each other at random:
num1=$(( $RANDOM % 10 ))
num2=$num1
while
do
num2=$(( $RANDOM % 10 ))
done
num3=$num1
while
do
while
do... (1 Reply)
Discussion started by: ale.dle
1 Replies
7. UNIX for Dummies Questions & Answers
Hi, I need some help to figure out why an outer for loop KSH variable does not decode in AWK but inner for loop does. Below is my code,
If I hard code variable 'SUBSEQ' in AWK it works but if I try to pass the SUBSEQ from KSH, it does not and when I pass the variable 'NAM' from KSH it works: I... (1 Reply)
Discussion started by: chowdhut
1 Replies
8. Shell Programming and Scripting
Hi,
I am looking at a script, and it contains lines like:
if ]
...
This is getting me confused. Why do we need $ before (echo $* | egrep -c 'DG')? Why can't we simply have:
if ]
... i.e. no $ here before the ()...
Thanks.
J (3 Replies)
Discussion started by: JamesByars
3 Replies
9. UNIX for Dummies Questions & Answers
How can I know if my system has ksh feature?
#!/usr/bin/ksh
Which command we allow me to see? Please advise! (1 Reply)
Discussion started by: bobo
1 Replies
10. Shell Programming and Scripting
Wondering what this line meant, especially the 2>&1 and ${RUN_DIR} parts:
${RUN_DIR}/<filename> 2>&1
Where <filename> is the location and name of a file. (1 Reply)
Discussion started by: CapsuleCorpJX
1 Replies