Sponsored Content
Operating Systems Solaris Tilde prefix returns invalid home directory. Post 302895948 by thinkster on Thursday 3rd of April 2014 11:44:57 AM
Old 04-03-2014
Question Tilde prefix returns invalid home directory.

I am trying to find the home directory of users on a UNIX (Solaris/AIX) box using
Code:
echo ~username

This does return the home directory for all valid users. For some reason this command also outputs home directory which are non-existent for few users who seem not to have logon access to that server.

For eg. the above command would return below for a non-existent user - /home/username

What I expected was - ~username as the output for a user with no access and that does happen with certain usernames.

This makes me think what could be causing a difference between different users who do not have access to this server. Has this something to do with LDAP?

Nothing I can find in /etc/passwd either.

Last edited by thinkster; 04-03-2014 at 01:42 PM.. Reason: This thread should be moved to a Shell scripting forum as it no more looks to be an issue just with Solaris.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

c++ home directory??

when i compile *.cpp files the compiler didn't find the non standart includes.If i have to put the full path of the includet files where shall i begin from root dirctory or i heve to put includet files in cpp home directory??? can i compile java files in unix(linux mandrake 7) if yes haw... (3 Replies)
Discussion started by: user666
3 Replies

2. Programming

Getting Home Directory

Hi I need to get the home directory of current user who is running the program, also i need to store the value in a particular variable and pass to the function. thanks in advance (4 Replies)
Discussion started by: cutechaps
4 Replies

3. Solaris

Restricting SFTP user to a defined directory and home directory

Hi, I've created solaris user which has both FTP and SFTP Access. Using the "ftpaccess" configuration file options "guest-root" and "restricted-uid", i can restrict the user to a specific directory. But I'm unable to restrict the user when the user is logged in using SFTP. The aim is to... (1 Reply)
Discussion started by: sftpuser
1 Replies

4. Shell Programming and Scripting

for $word in $line returns filenames in the current directory unexpectedly

I am writing a script below, which has 2 loops. The outer one reads file sufffixed with a number and inner inside which loop through each line of the file and display each space delimited string. However, i find that the string printed out in the inner loop includes not only the delimited string in... (2 Replies)
Discussion started by: martie
2 Replies

5. Shell Programming and Scripting

Find all images, append unique prefix to name and move to different directory

Hi, I have a directory with Multiple subdirectories and 1000s of pictures (jpg) in each directory. The problem is that each directory has a 001.jpg in them. I want to append a unique name (the directory_name)would be fine. and then move them to one main backup directory once they have been... (1 Reply)
Discussion started by: kmaq7621
1 Replies

6. Shell Programming and Scripting

rm -rf ab returns find: `./ab': No such file or directory

Hi Gurus. This is driving me a bit batty. I now if must be a simple matter but I cant find anything that references it. I have a housekeeping script that searches for some huge dump directories then removes them using rm -rf. find ./ -name 'ab' -exec rm -rf {} \; This works but always... (7 Replies)
Discussion started by: rinser
7 Replies

7. Shell Programming and Scripting

Extract Uniq prefix from a start and end prefix

Dear All, assume i have a file with content: <Start>6000</Start> <Stop>7599</Stop> the output is: 6000 7000 7100 7200 7300 7400 7599 how should we use any awk, sed, perl can do this task, means to extract the uniq prefixes from the start and stop prefix. Thanks Jimmy (3 Replies)
Discussion started by: jimmy_y
3 Replies

8. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies

9. Windows & DOS: Issues & Discussions

Home Questions Tags Users Unanswered Windows 2016 DNS server returns SERVFAIL for non-existing doma

I have two DNS resolvers in /etc/resolv.conf file. The top one is Windows DNS server, and the bottom one is my wi-fi router. Please see below. nameserver 192.168.1.126 nameserver 192.168.1.1 In Windows DNS server, the sole "Forward Lookup Zone" is biman.net When I query for host in the zone... (6 Replies)
Discussion started by: broy32000
6 Replies
qmail-pw2u(8)						      System Manager's Manual						     qmail-pw2u(8)

NAME
qmail-pw2u - build address assignments from a passwd file SYNOPSIS
qmail-pw2u [ -/ohHuUC ] [ -cchar ] DESCRIPTION
qmail-pw2u reads a V7-format passwd file from standard input and prints a qmail-users-format assignment file. A V7-format passwd file is a series of lines. Each line has the format user:password:uid:gid:gecos:home:shell where user is an account name, uid and gid are the user id and group id of that account, and home is the account's home directory. pass- word, gecos, and shell are ignored by qmail-pw2u. If you put the output of qmail-pw2u into /var/lib/qmail/users/assign, and then run qmail-newu, qmail-lspawn will obey the assignments printed by qmail-pw2u. WARNING: After changing any users, uids, gids, or home directories in your passwd file, you must run qmail-pw2u and qmail-newu again if you want qmail-lspawn to see the changes. RULES
By default, qmail-pw2u follows the same rules as qmail-getpw. It skips user if (1) uid is zero, (2) home does not exist, (3) user does not own home, or (4) user contains uppercase letters. It then gives each remaining user control over the basic user address and all addresses of the form user-anything. A catch-all user, alias, controls all other addresses. You may change these rules by setting up files in /var/lib/qmail/users: include Allowed users, one per line. If include exists, and user is not listed in include, user is ignored. exclude Ignored users, one per line. If exclude exists, and user is listed in exclude, user is ignored. mailnames Replacement names for users. Each line has the form user:mailname1:mailname2:... The addresses mailname1 and mailname1-ext and mailname2 and so on will be delivered to user. WARNING: The addresses user and user-ext will not be delivered to user unless user is listed as one of the mailnames. A line in mailnames is silently ignored if the user does not exist. subusers Extra addresses. Each line has the form sub:user:pre: sub will be handled by home/.qmail-pre, where home is user's home directory; sub-ext will be handled by home/.qmail-pre-ext. append Extra assignments, printed at the end of qmail-pw2u's output. OPTIONS
-o (Default.) Skip user if home does not exist (or is not visible to qmail-pw2u). Skip user if home is not owned by user. -h Stop if home does not exist. This is appropriate if every user is supposed to have a home directory. Skip user if home is not owned by user. -H Do not check the existence or ownership of home. -U (Default.) Skip user if there are any uppercase letters in user. -u Allow uppercase letters in user. -cchar Use char as the user-extension delimiter in place of -. -C Disable the user-extension mechanism. -/ Use home/.qmail-/... instead of home/.qmail-... SEE ALSO
qmail-users(5), qmail-lspawn(8), qmail-newu(8), qmail-getpw(8) qmail-pw2u(8)
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy