Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!

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.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Thank you very much Mr. Cheesus that fixed the problem and then I needed to add the "end", but for some reason it is not creating the accounts. I was thinking that there is a command that pipes the error messages into a file I am not sure about that command but I believe is something like
./accounts.csh f 101 103 >> 0 /home/user/Desktop/file.txt something like that, can anybody confirm that please? other wise I will ask google, thank you.

---DELETED BECAUSE IT WAS TERRIBLY WRONG---
But be careful, do not destroy your /etc/passwd, or you will never again log in ;-)
Better use useradd, adduser, or similar, depending on your distribution.
Cheers!

I swear I was sober when I wrote the above, but it's of course terribly wrong.
">" is write to stdout
">>" is append to stdout
"2>" is write to stderr
"2>>" is append to stderr
so actually ">>/etc/passwd" should have worked,
if you ran the script as user root
and if your system doesn't use /etc/shadow
but of course useradd, useradd or similar is still a good idea.
Cheers, Tom.

Ok I found out that in order to concatenate I just need to put one variable next to the other such as in this exmple.

There is no concatenation operator. To concatenate strings, put them one next to the other.
set newstring = aaa$string1${string2}bbb

So, what I don't understand is why when I run the script as :
./accounts f 101 103 2> errors
$cat errors
cat: f: No such file or directory
cat: 101: No such file or directory
cat: 103: No such file or directory

Well, since f/101/103 are your params, you're probably executing $1/$2/$3.
Actually, I thougt putting the paranthesis () to while would solve that.
I any case, you need to post the current version of your script...

As I have been working on the script I found this command which tells me what lines work.
So now when I type: csh -x ./accounts.csh f 101 103
shows:
set letter=f
set start=101
set end=103
set password=foobar
set group=10
set path=/export/home
set shell=/bin/sh
set logine=f101
while ( 101 -le 103 )
while: Expression Syntax.

Which means that there is a problem with the syntax of the while loop, but I have been looking and I see no problem with the while loop. I will try to do it with ksh and see if it works.

Well, I have checked every line of the script and browse the internet to look up for the syntax of the while loop for csh and I couldn't find any thing that would help me. Yes I found many places that showed me how the syntax goes but nothing different to what I had. So, what I decided to do is to re-do it in korn shell and it seems that it worked now. I just have to wait to go to the class room and run it, but it works in my machine. Thank you for your help cheesus & Chrism01. I will post my script as soon as I finish the test of Calculus tomorrow.