10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I'm trying to understand better the while and until loops, can someone help me with this example?
#!/bin/bash
# Listing the planets.
for planet in Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto
do
echo $planet # Each planet on a separate line.
done
echo; echo
for... (3 Replies)
Discussion started by: jose2802
3 Replies
2. Shell Programming and Scripting
My apologies for the long post....
I have a structure problem with my ksh script on linux.
right now it does what i want (which i know is the point) but its really really ugly and i know there must be a simpler way to achieve my task.
The data is a list of usernames. This list will help... (2 Replies)
Discussion started by: maverick72
2 Replies
3. Shell Programming and Scripting
Hi please help.
I have a file with two columns.
I want to insert the value of the first column and second column in different sections of a line.
code:
for line in `cat $1`;
for x in `cat $1 |awk '{print $2}'`;
do
do
echo "print $line and then print $x"
done
done
It works... (8 Replies)
Discussion started by: cinderella
8 Replies
4. Shell Programming and Scripting
Hi All
I have some directories on our server which are containing .csv files. i need to print value of cell "B2" from those csv files. Please advise.
I have tried head command as example: head -2 */Book_Collection_Report_1_-_Collection_Requests_trials.csv | sed -n "3p" | awk -F","... (4 Replies)
Discussion started by: yash1978
4 Replies
5. Shell Programming and Scripting
Hi All,
I want to execute a script the number of times a user enters. Please can you advise on hor can I do the same.
Many Thanks,
Shazin (4 Replies)
Discussion started by: Shazin
4 Replies
6. UNIX for Dummies Questions & Answers
I am traversing down a list, and I am not quite sure how to tell the loop to break when it's done going through the file.
#!/bin/sh
while :
do
read list <&3
echo $list
done
is the code. The file "list" is simply
5
4
3
2
1
any advice on how to break the loop after the file is... (1 Reply)
Discussion started by: MaestroRage
1 Replies
7. UNIX for Dummies Questions & Answers
Hi,
how can I use "for" to have two loops :
this is my script :
for i in (A B C)
do
for j in (a b c)
do
echo $i$j
done
done
#End
I want to print out
Aa
Ab
Ac ....
But I have error message :
syntax error at line 1 : `(' unexpected
Many thanks before.
How should I use "for" ?? (2 Replies)
Discussion started by: big123456
2 Replies
8. UNIX for Dummies Questions & Answers
I'm trying to create a loop that will prompt the user for 15 values, not forcing them to enter all 15. If the user enters through one or more of the prompts the null value needs to be converted to 0, otherwise set the parameter = to the value entered:
ex.
Please enter file no #1: 17920
... (4 Replies)
Discussion started by: vdc
4 Replies
9. Shell Programming and Scripting
I am running on HPUX using ksh.
I have a script that uses a loop within a loop, for some reason the script seems to hang on a particuliar record. The record is fine and hits the condition in Blue. If I kill the 1st loop process the script continues on with no problem.
Begin code>
<Some... (8 Replies)
Discussion started by: bthomas
8 Replies
10. Shell Programming and Scripting
Hello Guys
I need some help with my script
I'm not very good at this, hope you can point me in the right direction.
My idea, to write a file with some router commands and use it on a script for me to run on a demand basis, ( or added to the cron, if I get it to work).
The below script works,... (5 Replies)
Discussion started by: tony3101
5 Replies