You've hit the nail on the head. The slant in the original pattern is causing your grief. The format of the sed substitute command is:
s<delim>pattern<delim>replacement<delim>
The delim character can be anything, but it cannot occur in the pattern. By having a pattern with a slant, you're "marking" the end of the pattern early, and then you're tossing in extra information that sed is complaining about.
Assuming that you're using Kshell or bash, then something like this would work:
The shell magic converts all forward slants in test1 and test2 into "\/" combinations which escape the slant when sed reads the string. It should now be fine. And if there aren't any slants, then the string is not affected.
---------- Post updated at 20:29 ---------- Previous update was at 20:03 ----------
It just occurred to me that you might need to escape other characters on the pattern side. Specifically the dot (.) and splat (*) need to be escaped. These additional lines should do the trick.
Hello everyone let me start off by saying happy new year to all
I am new to this board.
I am running a multipurpose server (web/ftp/email) it runs apache 1.3.20 i think it is and Qmail
would I would like to do is find/create a script that will allow my users to change there unix password... (1 Reply)
I am the administrator for a large network of HP/UX servers, about 100, this will be growing to over 200 in the next 18 months, part of my duties are to change the root passwords on these machines once month... which is a pain. I have written a script that will generate random passwords for me and... (3 Replies)
Just wanted options of this - first 'real' Perl script and I'm not positive of all the quirks in Perl. Any suggestions are welcome.
Especially since I'm messing with /etc/shadow! Running Solaris 2.6, Perl 5.005.03
#!/u/bin/perl
#
# Change the user's old password to the new in /etc/shadow ... (3 Replies)
now, for reasons i really cant begin to delve into, i have to find a way to be able to rmeotely create user accounts and also assign them passwords. unfortunately, it appears Sun boxes frowns upon this. sun boxes will let u create a user account remotely but will never let u assign the useraccount... (0 Replies)
Hi All,
I am looking for scripts where i need check normal user password and root password for more 100 servers from single server...!
let me explin it what exacltly i need...!
i need to do password audit for more than 600 boxes... :o
for one normal user and root password also...... (5 Replies)
What is the best way to monitor who changes passwords, or what passwords get changed? Is there a way to send that over to Syslog?
An example would be someone logs in as themselves, changes to root (which I capture by loging auth and auth.info) and then changes a password.
Do I need to put an... (1 Reply)
Hello,
We are running aix 5.3.
We're looking for a script that can change passwords, taking 2 arguments ( old password, new password ).
I am wondering if this can be done with a here document, or some generic scripting method.
Or, if I would have to download expect.
Alternatively I wonder... (3 Replies)
I've been using various versions of UNIX and Linux since 1993, and I've never run across one that showed your password as you type it in when you log in, or one that stored passwords in plain text rather than encrypted. I'm writing a script for work for a security audit, and two of the... (5 Replies)
Discussion started by: Anne Neville
5 Replies
LEARN ABOUT SUSE
lppasswd
lppasswd(1) Apple Inc. lppasswd(1)NAME
lppasswd - add, change, or delete digest passwords.
SYNOPSIS
lppasswd [ username ]
lppasswd -a [ -g groupname ] username
lppasswd -x username
DESCRIPTION
lppasswd adds, changes, or deletes passwords in the CUPS digest password file, passwd.md5. When run by a normal user, lppasswd will prompt
for the old and new passwords. When run by the super-user, lppasswd can add new accounts (-a username), change existing accounts (user-
name), or delete accounts (-x username) in the digest password file. Digest usernames do not have to match local UNIX usernames.
OPTIONS
lppasswd supports the following options:
-g groupname
Specifies a group other than the default system group.
SECURITY ISSUES
By default, the lppasswd program is not installed to allow ordinary users to change their passwords. To enable this, the lppasswd command
must be made setuid to root with the command:
chmod u+s lppasswd
While every attempt has been made to make lppasswd secure against exploits that could grant super-user privileges to unprivileged users,
paranoid system administrators may wish to use Basic authentication with accounts managed by PAM instead.
SEE ALSO lp(1), lpr(1),
http://localhost:631/help
COPYRIGHT
Copyright 2007-2009 by Apple Inc.
22 February 2008 CUPS lppasswd(1)