03-24-2013
Creating a .profile, displaying system variables, and creating an alias
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Here is what I am supposed to do, word for word from my assignment page:
1. Create/modify and print a .profile that does the following:
a) Displays the date and time
b) Lists all the current users
c) Adds the users home directory and the current directory to the PATH
d) Changes the prompt to display the current directory
2. Display the current system variables
3. Create an alias for a command that will look for your name in the password file
2. Relevant commands, code, scripts, algorithms:
.profile, alias
3. The attempts at a solution (include all code and scripts):
Here is what I have for each step above:
1. Create/modify and print a .profile that does the following:
a) date
b) users
c) export PS1='${PWD} '
d) PATH=$PATH:$HOME:$PWD
2. set
3. alias findmyname="grep /etc/passwd"
A couple questions:
1. My teacher wants me to print a listing of the profile. Would I just do "touch .profile" and then append (using ">>") the commands to the file, then print it?
2. I am not sure if my alias is correct. Not sure how to find the exact location of the passwd file
Thanks in advance.
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Brookdale Community College - Lincroft, New Jersey - United States - Dr. Rick Bournique- COMP 145
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am trying to create an alias for a frequently used directory path by using
alias xyz="/proj/dir_name"
and then trying to reach a sub-directoy by using
cd xyz/abc
but I get an error saying " No such file or directory "
plz tell me wats wrong with this ... (3 Replies)
Discussion started by: jasjot31
3 Replies
2. OS X (Apple)
Does any1 know how to preform such an operation on a mac?
any help appreciated (2 Replies)
Discussion started by: cleansing_flame
2 Replies
3. AIX
I created a profile in HMC for a new LPAR and activated it but not yet installed AIX.
Is there a step to make this new LPAR available as vhostX from the VIO server after creating and activating an HMC profile?
I already shared the CD-ROM device from the HMC profile.
Thanks.
-... (1 Reply)
Discussion started by: learner1
1 Replies
4. Solaris
Hello,
I need the command to create alias for a file "FILE" (NOT for commands) ? And Is there any difference between creating alias for files and creating alias for commands ?
For info, i'm using Solaris 8
Thx,
http://www.unix.com/images/misc/progress.gif (5 Replies)
Discussion started by: newpromo
5 Replies
5. UNIX for Dummies Questions & Answers
Hi,
We have a load of users which point to the same basic profile by a link:
.profile -> /export/home/dusers/INIT/dot.profile
I'd like to create a seperate profile for one user -testu12. If I remove the link from his profile will it delete the actual dot.profile file?
I've tried to do a... (4 Replies)
Discussion started by: Grueben
4 Replies
6. Shell Programming and Scripting
I am new in shell scripting. currently i am using cygwin. My problem is
i created a profile file in my own folder. file name is first.profile in which i gave following values to variable
export a=10
now i am executing this profile file by below command
./.first.profile
it executed... (4 Replies)
Discussion started by: pratikjain998
4 Replies
7. Shell Programming and Scripting
first i created a profile file(my_var.profile) which contains
export my_var=20
after that i created shell scripts(my_var.sh) which contains
#!/bin/bash
. ./my_var.profile
echo '$my_var='$my_var
but when i am executing sh my_var.sh it is showing error that no such file/directory .profile.... (6 Replies)
Discussion started by: pratikjain998
6 Replies
8. Shell Programming and Scripting
I want to create an alias as follows but is not working
alias ../='cd ../' (3 Replies)
Discussion started by: kristinu
3 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I want to create an alias for this command:
grep -i "<keyword_to_search>" <path_to_search>
Here's the alias I intended to make:
alias k 'set ARGS1 =(\!1); set ARGS2 =(\!2); grep -i "$ARGS1" ARGS2'
So that next time, for example, if I want to search the keyword "Help" in the path... (5 Replies)
Discussion started by: mar85
5 Replies
10. OS X (Apple)
Hi,
I'm using Mac 10.9.1. I would like to create an alias for grep so that it won't print out messages like "grep: /Users/davea/workspace/myproject/subdir/: Is a directory" all the time. So in my terminal, I opened ~/.profile and entered
alias grep='grep -s'
However, when I close and... (5 Replies)
Discussion started by: laredotornado
5 Replies
LEARN ABOUT SUNOS
registration_profile
registration_profile(4) registration_profile(4)
NAME
registration_profile - template for Basic Registration information
SYNOPSIS
registration.profile
The registration profile is a template for the information provided for Basic Registration. The information in this template is consumed by
the sconadm(1M) utility. sconadm is the command-line alternative to the Basic Registration GUI.
An example of the registration profile template is provided in /var/lib/breg/data/RegistrationProfile.properties. This file is owned by
root, with read-only permissions. As root, you can copy the file to a location of your choosing and edit the file.
The registration profile template contains the following properties:
userName=
password=
hostName=
subscriptionKey=
portalEnabled=
proxyHostName=
proxyPort=
proxyUserName=
proxyPassword=
Values are not required for every property. The filling in or leaving blank a property depends on the task you intend to perform. Possible
tasks are registering a new system, reregistering a system, and establishing a proxy. See sconadm(1M) for examples.
The properties defined for a registration template are as follows:
userName
Corresponds to Sun Online Account user name.
password
Corresponds to Sun Online Account password.
hostName
Portal Common Name (defaults to Unix host name, if not provided).
subscriptionKey
Enable access to all updates by providing your Sun Subscription Key for entitlement.
portalEnabled
If true, enable local client to be managed at the Sun-hosted Update Connection Service. If false, disable local client to be managed at
the Sun-hosted Update Connection Service.
proxyHostName
Your HTTP web proxy host name.
proxyPort
Your HTTP web proxy port number.
proxyUserName
Your HTTP web proxy user name.
proxyPassword
Your HTTP web proxy password.
Example 1: Sample Registration Profile
Below are the contents of a sample registration profile. Such a profile might be used to specify a proxy server with authentication.
userName=
password=
hostName=
subscriptionKey=
portalEnabled=
proxyHostName=webcache.mycompany.com
proxyPort=8080
proxyUserName=myCompanyProxyUserName
proxyPassword=myCompanyProxyPassword
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWbreg |
+-----------------------------+-----------------------------+
|Interface Stability |Stable |
+-----------------------------+-----------------------------+
sconadm(1M), attributes(5)
20 Sep 2005 registration_profile(4)