[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

what does this code mean?

Posted on 2014-04-23
5
Medium Priority
?
335 Views
Last Modified: 2014-05-01
I came cross these lines of codes and can't understand them. Anyone here could help me with them?  Thank you.

#PS1="\[\033[1;31m\][\$(date +%H%M)][\u@\h \[\033[01;34m\]\W $ \[\033[00m\]"
#PS2='> '
#PS4='+ '

#if [ $USER = "oracle" ]; then
#  if [ $SHELL = "/bin/ksh" ]; then
#    ulimit -p 16384
#    ulimit -n 65536
#  else
#    ulimit -u 16384 -n 65536
#  fi
#fi
0
Comment
Question by:Jason Yu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 5

Accepted Solution

by:
Pasha Kravtsov earned 668 total points
ID: 40018923
PS1 is part of a configuration which you can see by typing 'set' into the console. Specifically whenever you use bash or sh you see usually
[user@hostname directory/you're/at] $ ls

Open in new window

Something of that nature and PS2 and PS4 if I recall correctly do the same thing just different sytles? Here is a great article on it http://www.thegeekstuff.com/2008/09/bash-shell-take-control-of-ps1-ps2-ps3-ps4-and-prompt_command/

looks like if your user is oracle then see if it's using the shell ksh and change ulimit options based on it
http://ss64.com/bash/ulimit.html
^ great man page on it
0
 
LVL 84

Assisted Solution

by:ozo
ozo earned 668 total points
ID: 40022409
Is there a #! line at the top of the file to say what language this is in?
It looks like all the code is commented out, so it seems to mean nothing.
0
 
LVL 20

Assisted Solution

by:simon3270
simon3270 earned 664 total points
ID: 40023153
The PS1 lines set sthe shell prompt to the current time (HHMM), the user name and the host name (all in red), then the current directory (just the directory name, not the full path) in light blue.

PS2 is the prompt used when a continuation line is required (e.g. if you don't close a quoted string on the command line, or you type a "for" or "while" loop into the shell.

PS4 is the string that the shell uses to go in front of lines it will be executing, if "set -x" has been run.

The "if" test at the end only does the work for the "oracle" user.  It sets the maximum size of a pipe between processes (the "-p" option), and the maximum number of open file descriptors (-n).  In the Korn shell, these must be done as separate commands - in other shells they can be done as multiple settings on a single command (though note that the Bash shell says that you can't set -p).
0
 
LVL 5

Expert Comment

by:Pasha Kravtsov
ID: 40023210
@ozo that might be your .bashrc? I'm not sure
0
 

Author Comment

by:Jason Yu
ID: 40035002
yes, it's from a .bashrc file. I will read all the references.

Thank you guys here.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question