Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I copy and pasted your script into the file test.sh, made it executable and then started it. This is the output:
Code:
tobi@dragon ~ :) % ./test.sh
GNU bash, version 4.1.10(2)-release (i486-slackware-linux-gnu)
Counting Line 0
Counting Line 1
Counting Line 2
Counting Line 3
Counting Line 4
Counting Line 5
Counting Line 6
Counting Line 7
Counting Line 8
Counting Line 9
Counting Line 10
Counting Line 11
Counting Line 12
Counting Line 13
Counting Line 14
Counting Line 15
Counting Line 16
Counting Line 17
Counting Line 18
Counting Line 19
Counting Line 20
Counting Line 21
Counting Line 22
Counting Line 23
Counting Line 24
Counting Line 25
Counting Line 26
Counting Line 27
Counting Line 28
Counting Line 29
Counting Line 30
Counting Line 31
Counting Line 32
Counting Line 33
Counting Line 34
Counting Line 35
Counting Line 36
Counting Line 37
Counting Line 38
Counting Line 39
Counting Line 40
Counting Line 41
Counting Line 42
Counting Line 43
Counting Line 44
Counting Line 45
Counting Line 46
Counting Line 47
Counting Line 48
Counting Line 49
Counting Line 50
Counting Line 51
Counting Line 52
Counting Line 53
Counting Line 54
Counting Line 55
Counting Line 56
Counting Line 57
Counting Line 58
Counting Line 59
Counting Line 60
Counting Line 61
Counting Line 62
Counting Line 63
Counting Line 64
Counting Line 65
Counting Line 66
Counting Line 67
Counting Line 68
Counting Line 69
Counting Line 70
Counting Line 71
Counting Line 72
Counting Line 73
Counting Line 74
Counting Line 75
Counting Line 76
Counting Line 77
Counting Line 78
Counting Line 79
Counting Line 80
Counting Line 81
Counting Line 82
Counting Line 83
Counting Line 84
Counting Line 85
tobi@dragon ~ :) %
To make sure that this is not a shell related problem (I am using zsh instead of bash) I also started it with
When I just tried doing ./test.sh I got the same weird output, however when I changed the first line to specify bash, then ran the script, I got the expected output of:
Code:
Counting Line 0
Counting Line 1
Counting Line 2
Counting Line 3
Counting Line 4
........
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.