10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have 3 loops that I use to determine the permission level of AWS user accounts.
This array lists the AWS policy ARN (Amazon Resource Name):
for ((policy_index=0;policy_index<${#aws_managed_policies};++policy_index)); do
aws_policy_arn="${aws_managed_policies}"
... (1 Reply)
Discussion started by: bluethundr
1 Replies
2. Shell Programming and Scripting
I have a script to start/stop/restart the tomcat application. When we run the script first time i.e stop/start it set all env variables(DISTRIB_ID,NAME,TOMCAT_CFG,....etc),but when we restart the tomcat it is running in the same shell.....I need to set the variables when i restart the tomcat(in the... (1 Reply)
Discussion started by: praveen265
1 Replies
3. Shell Programming and Scripting
I am trying to use two nested for loops to process some files and then create a new file using both variables in the output file name. I have several files in this naming style:
S1_L3_all_R1.fastq
S1_L3_all_R2.fastq
S1_L4_all_R1.fastq
S1_L4_all_R2.fastq
.
.
S1_L8_all_R1.fastq... (3 Replies)
Discussion started by: aminards
3 Replies
4. Shell Programming and Scripting
hello
i'm writing a script and I want to use a for loop inside a while loop as following:
while read line;
do
echo $line
for i in $vrm;
do
echo $i
done
done < './contacts'
when i use just the while loop it prints the lines from file ./contacts just... (13 Replies)
Discussion started by: vlm
13 Replies
5. 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:
Your shell script should continue to execute until the user selects option 4
2. Relevant commands, code,... (2 Replies)
Discussion started by: boyboy1212
2 Replies
6. Shell Programming and Scripting
Hi script gurus.
I have need to know how to use for loop with multiple variable.
Basically lets take for example /etc/passwd file has following entries
The above cat command will basically first greps the real users that have email addresses then converts ':' to '+' then using cut... (4 Replies)
Discussion started by: sparcguy
4 Replies
7. Shell Programming and Scripting
Hi!
Could someone explain me why the below code is printing the contents of IF block 5 times instead of 0?
#!/bin/bash
VAR1="something"
VAR2="something"
for((i=0;i<10;i++))
do
if(($VAR1=~$VAR2))
then
echo VAR1: $VAR1
echo... (3 Replies)
Discussion started by: machinogodzilla
3 Replies
8. Shell Programming and Scripting
hi guys,
i have an array called ARRAY which has elements in it... i am trying to assign elements of ARRAY to master_array..
i get a =: command not found error..
i=0
while
do
${master_array}=${ARRAY}
((i++))
done
is there something i am missing? (4 Replies)
Discussion started by: npatwardhan
4 Replies
9. Shell Programming and Scripting
Surely there's an easier way to do this, lets see if anyone knows! I am new to scripting so go easy on me!
I have the following script and at the moment it doesn't work and I believe the problem is that I am using a while loop within a while loop. When I run the script using sh -x I can see... (6 Replies)
Discussion started by: StevePace
6 Replies
10. UNIX for Dummies Questions & Answers
I have a while read loop that reads values inside of a file and then performs an expr operation on each.
Everything works fine, the way it's supposed to but, once the loop is finished, I can not access the variable that I used inside of the loop (but that variable was created outside of the... (7 Replies)
Discussion started by: yongho
7 Replies