suser <[EMAIL PROTECTED]> writes:

> I am trying to create a script to go through /etc/passwd and change anyone
> who's home directory is "/mnt/home" to "/mnt/<username on linux server>".

This does not really has anything to do with bash, let alone with bugs
in bash, so it is rather off-topic here.

> Original - user:x:1000:100:user:/mnt/home:/bin/bash
>
> what i want - user:x:1000:100:user:/mnt/user:/bin/bash
>
> any suggestions? thanks in advance!

$ awk -F: '$6 == "/mnt/home" { $6 = "/mnt/" $1 }' < input > output

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Reply via email to