Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-10-2003, 01:12 AM   #1
LQ Newbie
Registered: Apr 2003
Posts: 11

Rep: Reputation: 0
bourne shell /etc/passwd /etc/shadow



IFS=":" ; export IFS
cat /cygdrive/h/etc/passwd | while read username passwd_placeholder userid groupid gecos home_dir shell; do
if [ $userid -gt 500 ] ; then
shadow_line=`grep "^$username:" /cygdrive/h/etc/shadow`
`echo $shadow_line | awk -F: '{ print $1":"$3":"$4":"$5":"$6 }' /cygdrive/h/etc/shadow` > $TEMPFILE1

i have been figuring out abt this for a week. i have problem extracting info from /etc/shadow with username input from /etc/passwd & output to a temp file for comparing data later on. help is appreciated! thanks!
Old 05-09-2003, 12:23 PM   #2
Registered: Oct 2002
Location: Curitiba - Brazil
Distribution: Conectiva
Posts: 334

Rep: Reputation: 30
In the line:

`echo $shadow_line | awk -F: '{ print $1":"$3":"$4":"$5":"$6 }' /cygdrive/h/etc/shadow` > $TEMPFILE1


echo $shadow_line | awk -F: '{ print $1":"$3":"$4":"$5":"$6 }' /cygdrive/h/etc/shadow > $TEMPFILE1

Hope that helps ...
Old 05-10-2003, 12:09 AM   #3
LQ Newbie
Registered: Apr 2003
Posts: 11

Original Poster
Rep: Reputation: 0
thanks, i have long discarded that, did it another way.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 10:20 AM
Moving /etc/passwd and /etc/shadow john8675309 Linux - Software 1 01-24-2005 09:44 PM
It is ok if i unshadow the /etc/passwd and /etc/shadow Paxmaster Linux - Software 1 01-12-2005 11:07 PM
mismatch with /etc/passwd and /etc/shadow AngryKeebler Linux - General 1 07-23-2004 04:42 PM
/etc/passwd or /etc/shadow? tiger7007 Linux - Security 2 03-21-2004 05:41 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration