LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-16-2017, 12:14 PM   #1
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Rep: Reputation: Disabled
unknown bash command?


unknown bash command?

I look at many places, but could not find
bash information for d, gn and un.

I saw this fragment for bash:
Code:
 [ "`d -gn` : "`d -un`
What are d, gn and un?
Thanks.
 
Old 01-16-2017, 12:21 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,320
Blog Entries: 13

Rep: Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372
d is obviously an abbreviation for one bash command, and -gn -un are arguments it accepts.

I thought possibly "date", however it does not appear to have those arguments, or at least mine does not.

Any more details about how it is used?

Where did you get that from? Someone's script? Horrible script writer if so.
 
1 members found this post helpful.
Old 01-16-2017, 01:07 PM   #3
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
It looks as if it may have come from here (bottom answer): http://unix.stackexchange.com/questi...rs-under-linux

where it is:

Code:
[ "`id -gn`" = "`id -un`" ]
 
Old 01-16-2017, 01:11 PM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,320
Blog Entries: 13

Rep: Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372
Excellent find hydrurga.

Well obviously it was misquoted or "found" somewhere else where it was already corrupted from it's original form.
 
Old 01-16-2017, 01:11 PM   #5
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Original Poster
Rep: Reputation: Disabled
Thank you for responding.....

Quote:
Originally Posted by rtmistler View Post
d is obviously an abbreviation for one bash command, and -gn -un are arguments it accepts.

I thought possibly "date", however it does not appear to have those arguments, or at least mine does not.

Any more details about how it is used?

Where did you get that from? Someone's script? Horrible script writer if so.
It is from a RHCSA study guide book 7th edition, by Michael Jung.
Ops... I have to make corrections....

Excerpts:
Code:
The Default umask
With that in mind, the default umask is driven by the /etc/profile and /etc/bashrc
files, specifically the following stanza, which drives a value for umask depending on
the value of the UID:

if [ $UID -gt 199 ] && [ "`id -gn`“ = "‘`id -un`” ]; then
	umask 002
else
	umask 022
fi

In other words, the umask for user accounts with UIDs of 200 and above is 002.
In contrast, the umask for UIDs below 200 is 022. In RHEL 7, service users such as
adm, postfiX, and apache have lower UIDs; this affects primarily the permissions of
the log files created for such services. Of course, the root administrative user has
the lowest UID of 0. By default, files created for such users have 644 permissions;
directories created for such users have 755 permissions.

In contrast, regular users have a UID of 1000 and above. Files created by such
users normally have 664 permissions. Directories created by such users normally
have 775 permissions. Users can override the default settings by appending an
umask command in their ~/.bashrc or ~/.bash_profile.

The error on my part is "d" command should be "id" command.
Now I know what id is,.
I can now guess what gn and un are, i.e. group name and user name.
but I was not able to find it in bash documentation....

Last edited by fanoflq; 01-16-2017 at 01:22 PM.
 
Old 01-16-2017, 01:12 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,320
Blog Entries: 13

Rep: Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372
If that's really what the book quotes, then write to the publisher and inform them that they have an error.
 
Old 01-16-2017, 01:16 PM   #7
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,617
Blog Entries: 3

Rep: Reputation: 2871Reputation: 2871Reputation: 2871Reputation: 2871Reputation: 2871Reputation: 2871Reputation: 2871Reputation: 2871Reputation: 2871Reputation: 2871Reputation: 2871
As for the pieces, the [ is like the program test. The backticks ` are command substitution and could better be written as $( )
 
1 members found this post helpful.
Old 01-16-2017, 01:17 PM   #8
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Original Poster
Rep: Reputation: Disabled
Sorry folks.
Please see corrections in original post.
Thank you.
 
Old 01-16-2017, 01:20 PM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,320
Blog Entries: 13

Rep: Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372
Quote:
Originally Posted by fanoflq View Post
Sorry folks.
Please see corrections in original post.
Thank you.
OK, it's not a publication error. The command is also no longer an unknown, you should be able to review the manual page to see that it is used to print user and group information.

Does this resolve you question?
 
1 members found this post helpful.
Old 01-16-2017, 01:23 PM   #10
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Original Poster
Rep: Reputation: Disabled
Thumbs up !

Quote:
Originally Posted by rtmistler View Post
OK, it's not a publication error. The command is also no longer an unknown, you should be able to review the manual page to see that it is used to print user and group information.

Does this resolve you question?
Thank you.
I found the answer in here: man id
 
  


Reply


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
[SOLVED] Bash - Testing directories and Files where one folder is unknown? hyperdaz Linux - Server 17 05-10-2013 08:02 AM
LXer: Unknown Bash Tips and Tricks For Linux LXer Syndicated Linux News 0 03-01-2012 03:50 PM
Unknown bash history oggers Linux - Security 4 11-10-2008 03:55 PM
[bash] get user unknown ip from maillog kriezo Programming 2 02-19-2008 04:48 AM
bash: lha unknown command or something like that Ermac6 Linux - Newbie 0 04-24-2001 08:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:42 AM.

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