have to make a script that adds users and generates encrypted passwords.
When I run the script I have this error message: ". / Autouser.sh: line 29: $ 1: ambiguous redirect"
I really searched for a solution and I am a beginner ...
Your help would be welcome
Last edited by Helix_87; 05-21-2010 at 07:33 PM..
Reason: Please use code tags
If I were you I'd first remove/comment lines 13-25 from your last posting and see if that alone would work.
Then I'd uncomment line 13-16 and see if it still works, then 17-18, and so on...
Btw. in following two lines I wonder why you have "ligne" between pipe and cut?
Besides you should avoid whitespaces when you define variables (see the nice "arrows" that I have created).
Also check lines 17 + 19 for that whitespaces.
Last edited by pseudocoder; 05-23-2010 at 08:10 PM..
This User Gave Thanks to pseudocoder For This Post:
What's the value of $1? Is there a glob wildcard in it? Is it empty?
The issue almost certainly lies with the end of the while loop, "done < $1". Try double quoting the positional parameter:
Code:
done < "$1"
Regards,
Alister
If I add the double quotes have this error message:
---------- Post updated at 01:42 AM ---------- Previous update was at 01:31 AM ----------
Hi pseudocoder,
Thank you for your answer.
I tried what you told me but it does not work, always the same error ( ./autouser.sh: line 30: : any file or directory of this type)
How are you invoking autouser.sh? Exactly what are you typing? It looks like $1 is empty. Are you not passing an argument to the script?
Also, pseudocoder's advice regarding the whitespace is correct. The only reason you aren't seeing errors from that is because the redirection error aborts the script before it has a chance to execute those statements. (Nice catch, pseudocoder ).
Hi,
I would like to know wheather we can increase the quota for particular user automatically?
I am having requirement to increase the quota only for 2 days in a week. but that shoule be automatically instead of manualy modification.
is it possible? (3 Replies)
Ok, so I've been looking all over the place for how exactly to do this and I've become so bombarded with information I finally decided I'll pose the question here. I'm not a programmer or anything that hardcore, but if I see things already implemented and working examples I can easily learn and... (17 Replies)
Hi masters,
How to get auto answer option in scripting. for example in my script i uses the gpg command , in that beginning it will ask
passpharse : ( in that i need to type my passpharase)
and once i typed it will ask
Use this key anyway? ( for that answer will be yes)
for... (1 Reply)
Hello all:
Working on a job I was asked get a simple script to perform the following task and would like to ask for some help. I'm looking forward to learning more and diving deeper into the World of Open Source servers.
I need a script for a Unix server, using as few lines as possible, that... (4 Replies)
Hi guys,
May I know how do I list out in UX for
- all existing user accounts; sorted by activated/disabled
- primary/sec groups of each user
- date when the user accounts are created,
- user last logon date
- last password change date
Anyone had done scripting for these info?... (0 Replies)
i want to write to script which will login to su account without hving user interaction.( i know Super user password)
i wrote following script its also able to log into su account. but seesion gets terminates soon.
what can be done ???
or is there any other solution. i don't want to use expect... (6 Replies)
Does anyone have a good script / cron job that handles this?
I have looked in smit and see it is clearing this count with:
chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s '{userid}'
However when I looked around to find ways to automate this I have not found an easy... (0 Replies)
Hi,
I am trying to setup account locking in Solaris 9.
I have made the changes in /etc/default/login where
RETRIES=5 and
SYSLOG_FAILED_LOGINS=5
and in /etc/user_attr I am having:
test_user::::lock_after_retries=yes
Still I am not able to lock test_user after successive
unsuccessful... (1 Reply)
I run freebsd 4.8 and try to find the way or 'a' way to log in a certain user i created automaticaly at pc boot.
I have searched the net, the manuals, but found nothing...
could anyone please get me going by showing me an example or what file(s) i need to take a look at.
i am not working... (6 Replies)