Setting the command prompt...

Can anyone tell me what I would use to set the command prompt?
On HP-UX, I would reset the PS1 variable...
i.e. PS1="
\$ID @ \$HOST | \$PWD
--> "
On Linux, I would reset it as follows:
i.e. PS1="
\u @ \h | \W
--> "
Neither of these seems to work here...
I tried the following, and it give me the correct visual layout, but the values don't change when you change directories:
i.e. PS1="
`whoami` @ `uname -n` | `pwd`
--> "
Any help would be greatly appreciated...

Hi,
Changing Your Command Prompt
The syntax you use to change your command prompt depends on whether you are using the Bourne,
Korn or C shell.
Bourne and Korn Shells
For the Bourne or Korn shells, you redefine your command prompt with the PS1 command. The
following are three examples:
PS1=": "
PS1="`hostname`: "
PS1="`hostname`{`id`}}: "
The first example sets the prompt to a colon (:), followed by a space.
The second example creates a prompt consisting of your machine name followed by a colon and a
space.
The third example sets the prompt to your machine name, followed by your login name in braces
{}, a colon, and a space.
Type any of the examples above to change your current command prompt. The prompt will remain until
you change it again, or logout.
If you want to make your changes more permanent, add one of the above examples (or a prompt of your
own creation) to your .profile file. If you do this, the prompt you specify will appear each time you
login in or start a new shell.
C Shell
For the C shell, you personalize your command prompt with the set prompt command. The following
are three examples:
set prompt="% "
set prompt="`hostname`\!: "
set prompt="`hostname`{`id`}}: "
The first example sets the prompt to the percent sign, followed by a space.
The second example creates a prompt consisting of your machine name followed by the history
number of the command (hostname1, hostname2, hostname3, and so on).
The third example sets the prompt to your machine name, followed by your login name in braces, a
colon, and a space.
Type any of the examples above to change your current command prompt. The prompt will remain until
you change it again, or logout.
If you want to make your changes more permanent, add one of the above examples (or a prompt of your
own creation) to your .cshrc file. If you do this, the prompt you specify will appear each time you login
in or start a new shell.
Revert back.
Thanks.
Senthilkumar
SUN - DTS

Similar Messages

  • Setting classpath from the command prompt

    each time i try to set the classpath from the command prompt it is not always well done . can someone give a good format
    i.e set classpath = ;c:\document and settings\ luke

    each time i try to set the classpath from the command
    prompt it is not always well done . can someone give
    a good format
    i.e set classpath = ;c:\document and settings\ lukeThe best way is not doing it at all.
    Anyway, try:
    set classpath = ".;c:\document and settings\luke"

  • How can I pass a value to the command prompt?

    I was wondering how can I pass a value to the command prompt with Windows and Linux? I'm more interested in Linux's system than Windows though. Is there a way to return info from the command prompt?

    Here is a snippet from http://mindprod.com/jglossexec.html that explains how in detail.
    Runtime.getRuntime().exec("myprog.exe") will spawn an external process that runs in parallel with the Java execution. In Windows 95/98/ME/NT/2000/XP, you must use an explicit *.exe or *.com extension on the parameter. It is also best to fully qualify those names so that the system executable search path is irrelevant, and so you don't pick up some stray program off the path with the same name.
    To run a *.BAT, *.CMD, *.html *.BTM or URL you must invoke the command processor with these as a parameter. These extensions are not first class executables in Windows. They are input data for the command processor. You must also invoke the command processor when you want to use the < > | piping options, Here's how, presuming you are not interested in looking at the output:
    Runtime.getRuntime( ).exec ("command.com /E:1900 /C MyBat.bat" );
    Runtime.getRuntime( ).exec ("cmd.exe /E:1900 /C MyCmd.cmd" );
    Runtime.getRuntime( ).exec ("C:\\4DOS601\\4DOS.COM /E:1900 /C MyBtm.btm" );
    Runtime.getRuntime( ).exec ("D:\\4NT301\\4NT.EXE /E:1900 /C MyBtm.btm" );
    There are also overloaded forms of exec(),
    Runtime.getRuntime( ).exec ("command.com /E:1900 /C MyBat.bat", null);
    Runtime.getRuntime( ).exec ("command.com /E:1900 /C MyBat.bat", null, "C:\\SomeDirectory");
    The second argument can be a String [], and can be used to set environment variables. In the second case, "C:\\SomeDirectory" specifies a directory for the process to start in. If, for instance, your process saves files to disk, then this form allows you to specify which directory they will be saved in.
    Windows and NT will let you feed a URL string to the command processor and it will find a browser, launch the browser, and render the page, e.g.
    Runtime.getRuntime( ).exec ("command.com http://mindprod.com/projects.html" );
    Another lower level approach that does not require extension associations to be quite as well set up is:
    Runtime.getRuntime( ).exec ("rundll32 url.dll,FileProtocolHandler http://mindprod.com/projects.html" );
    Note that a URL is not the same thing as a file name. You can point your browser at a local file with something like this: file://localhost/E:/mindprod/jgloss.html or file:///E|/mindprod/jgloss.html.
    Composing just the right platform-specific command to launch browser and feed it a URL to display can be frustrating. You can use the BrowserLauncher package to do that for you.
    Note that
    rundll32.exe url.dll,FileProtocolHandler file:///E|/mindprod/jgloss.html
    won't work on the command line because | is reserved as the piping operator, though it will work as an exec parameter passed directly to the rundll32.exe executable.
    With explicit extensions and appropriately set up associations in Windows 95/98/ME/NT/2000/XP you can often bypass the command processor and invoke the file directly, even *.bat.
    Similarly, for Unix/Linux you must spawn the program that can process the script, e.g. bash. However, you can run scripts directly with exec if you do two things:
    Start the script with #!bash or whatever the interpreter's name is.
    Mark the script file itself with the executable attribute.
    Alternatively start the script interpreter, e.g.
    Runtime.getRuntime( ).exec (new String[]{"/bin/sh", "-c", "echo $SHELL"}";

  • Compiling via the command prompt?

    Hi, I need to compile a program via the command prompt, and I need help setting up the windows environmental variables. I have followed multiple online tutorials on how to do this, but I keep getting the classDefNotFound exception. Can somebody please tell me which variables I should set? Thanks.

    since you are getting a java error, you don't need to change your PATH. All what remains is your CLASSPATH variable. Let's say you have created a directory c:\classes and you store all your classes in subdirectories according to their package. Then your CLASSPATH would like like this:
    .;c:\classes
    Note the dot at the beginning, that means "current directory", so the directory where you invoke java/javac is also part of the classpath. Note also that each item in the classpath is seperated with a ; .
    If you need to add jars to the classpath, don't add the directory containing the jars but add the jars themselves.
    .;c:\classes;c:\jar\yourjar.jar;c:\jar\otherjar.jar
    Hope that helps.

  • How can i run application client from the command prompt ?

    Hi,
    I'm new to java & EJB. so can any body tell me the command to run the application client from the command prompt. Here is the code to print hello world:
    /* Remote interface */
    public interface Hello extends javax.ejb.EJBObject
         public String hello() throws      java.rmi.RemoteException;
    /* Home interface */
    public interface HelloHome extends javax.ejb.EJBHome
         Hello create() throws java.rmi.RemoteException, javax.ejb.CreateException;
    /* Stateless session bean class */
    public class HelloBean implements javax.ejb.SessionBean
         private javax.ejb.SessionContext ctx;
         public void ejbCreate(){
              System.out.println("ejbcreate()");
         public void ejbRemove(){
              System.out.println("ejbRemove()");
         public void ejbActivate(){
              System.out.println("ejbActivate()");
         public void ejbPassivate(){
              System.out.println("ejbejbPassivate()");
         public void setSessionContext(javax.ejb.SessionContext ctx){
              this.ctx=ctx;
         public String hello(){
              System.out.println("hello()");
              return "Hello, world!";
    /*Client class */
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import java.util.Properties;
    public class HelloClient
         public static void main(String[] args) throws Exception{
              Properties props=System.getProperties();
              Context ctx=new InitialContext(props);
              Object obj=ctx.lookup("HelloHome");
              HelloHome home=(HelloHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
              Hello hello=home.create();
              System.out.println(hello.hello());
              hello.remove();
    I have stored .java files in c:\ejb
    I have successfully created the .class files using javac command in the following directory :
    c:\ejb
    I have also created Helloworld.ear file in c:\ejb using sun application server which contains the following files:
    ejb-jar-ic.jar
    app-client-ic.jar
    sun-j2ee-ri.project
    application.xml
    sun-application.xml
    Manifest.mf
    But the problem is that i'm not able to run the HelloWorld.class file successfully from the command prompt. So please suggest me the comand.
    Thanx in advance.
    Best regards,
    Pankaj

    Hi
    You can run this code from the command prompt in the same way as you run any other simple java program. The only thing is you need to set the Home and Local interfaces in the classpath.And obviously if u had deployed the bean in ur app server container, then its all over.
    And one more thing is that u need to set the provider URL in the InitialContext created in the client program.
    Thanks
    Arun B

  • TS4123 I have problem with iTunes story (secure link to itunes store failed). I make In the "Command Prompt" screen, type in   netsh winsock reset the itune story is solve but after i close itunes the problem is back

    I have problem with iTunes story (secure link to itunes store failed). I make In the "Command Prompt" screen, type in   netsh winsock reset the itune story is solve but after i close itunes the problem is back

    The results show that you have a proxy server set and this can often cause problems with iTunes.
    The proxy setting can be accessed in Internet options>>Connections>>LAN Settings.
    Try un-checking the proxy server check box.
    It might also be a good idea to run a malware check if you didn't know you had the proxy server set.
    You can download a free version of an excellent scanner- Malwarebytes here:
    http://www.malwarebytes.org/

  • Starting a WSAD server from the command prompt and not from the IDE UI

    Hi,
    is there a way to run the WSAD server from the command prompt instead of using the IDE UI . i have tried starting the server from the Directory i have installed WSAD " D:\Program Files\IBM\WebsphereStudio\runtimes\base_v5\bin>startServer.bat" but it gives the Following error " The system cannot find the path specified." i am working . do i have to specify the workspace that i am currently working on

    to see if the network adapter has registered with OPMN run: opmnctl status
    the 6200 message is a timeout which can be set in opmn.xml, the reports server(s) and other processes managed by OPMN should still stop.
    Try opmnctl stopall or opmnctl shutdown
    Does the timeout shows up regularly ie can you repeat it?
    After the stopall or shutdown try to start everything up again and try to stop the single reports server process again.

  • Switching my output stream back to the command prompt

    Hi there,
    I was just wondering if anybody could tell me how I can switch back to printing lines in the command prompt after I've set the output stream to a text file.
    jjmclell

    ok, I started by changing the output stream to a text file as follows:
    String path = ("C:/JFiles/Harvest/");
    String filename = path + "Stand_ages.txt";
    System.out.println("Using file: " + filename);
    File file = new File(filename);
    FileOutputStream fos = new FileOutputStream(file);
    PrintStream ps = new PrintStream(fos);
    System.setOut(ps);
    This works fine. However, I'd also like to create other text files for other results from my program. I was able to do this, but what I can't do is get Java to print anything on the screen once I've started to print to text files. All I want is the location of the file to pop up for each of the text files that I create:
    System.out.println("Using file: " + filename);
    I tried this but it didn't work:
    String path2 = ("C:/JFiles/Harvest/");
    String filename2 = path2 + "Harvest_targets.txt";
    PrintStream ps2 = System.out;
    System.setOut(ps2);
    System.out.println("Using file: " + filename2);
    File file2 = new File(filename2);
    FileOutputStream fos2 = new FileOutputStream(file2);
    PrintStream ps3 = new PrintStream(fos2);
    System.setOut(ps3);
    What I wanted to do was briefly switch the output stream back to the command prompt just to print the one line and then switch back to printing to a text file. However, in my code, System.out.println("Using file: " + filename2); is just printing to the text file that I'm creating instead of showing up on the command prompt.
    Any help?
    jjmclell

  • Running commands from the Command Prompt -  Runtime.getRuntime().exec()

    Hi there,
    I'm already able to run several commands in the command prompt.
    But my problem is that I need all the commands that I run share the same context.
    If, for example, I run "cmd /c set HOME=C:" (1st command), I want to be able to access that variable the next time, so that later when I run "dir %home%" it shows the directories in c: (This is just a example this is not what I really want to do...)
    I used code posted in a newsgroup (don't remember which)
    This is the code I use to execute commands:
         private int execute(String command)
         int exitVal = 0;
    try
    String nomeOS = System.getProperty("os.name" );
    String[] cmd = new String[3];
    if( nomeOS.equals( "Windows NT" ) || nomeOS.equals("Windows 2000") )
    cmd[0]="cmd.exe";
    cmd[1]="/c";
    cmd[2]=command;
    else if( nomeOS.equals( "Windows 95" ) )
    cmd[0]="command.com";
    cmd[1]="/c";
    cmd[2]=command;
    if (rt==null)
         rt = Runtime.getRuntime();
              Process proc = rt.exec(cmd);
              CommandStream erro = null;
              // erros?
              if (proc.getErrorStream()!=null)
                   erro = new CommandStream(proc.getErrorStream());
                   erro.start();
    // output?
    CommandStream output = new
    CommandStream(proc.getInputStream());
    // arranque
    output.start();
    // erros???
    exitVal = proc.waitFor();
         } catch (IOException e)
                   System.out.println("Exce !!!" );
                   e.printStackTrace();
         catch (InterruptedException ie)
                   System.out.println("Ocorreu uma excep��o !!!" );
                   ie.printStackTrace();
    return exitVal;      

    My problem is bigger than setting a few parameters,
    I'm doing a GUI to a CVS client and the problem is that some commands of CVS only work if you're in the right directory, or if you're authenticated, and all of this is easily done doing a series of execution:
    In a command prompt opened I would:
    set cvsroot=:pserver:lpinho@w2palf38:/project
    cvs -d :pserver:lpinho:xxxxx@w2palf38:/project login
    mkdir temp_my_proj
    cd temp_my_proj
    cvs checkout my_projectAll this would make what I wanted...
    And there's another thing, when I set the envp, I get some errors like "cvs.exe is not recognized as an internal or external command" (the path went bye bye) and if I set the path (envp[0]="path=c:\cvsnt"), I'm able to run cvs but I get a crazy error "No such host is known" (I run exactly the same command in the command prompt and it works...)
    Do you know any way of getting the current environment, and pass it as the envp parameter?
    Thank You
    Luis Pinho

  • Is it possible to run a java program without using the command prompt?

    Hi,
    I was wondering whether it is possible to run a Java program (not an applet) without using a command line in the command prompt?
    Basically I want to run a program that will be continually running in the background and hence I don't want to have a command prompt screen loaded up as well - I just want the program to be running in the task bar.
    I know how to run the program in the task bar - but I still need to launch the program from the command prompt - is there anyway I can get a program running without having to start it from the command prompt?
    Cheers

    Or create a desktop shortcut (in Windows) or an application launcher ( in Linux GUI).

  • HT201413 how do i test a port on my windows 7 computer? i followed the steps in this article, but the command prompt said that "telnet" is not a valid command.

    So I havent been able to connect to the iTunes store since June. It's getting a tad annoying. I followed all of the troubleshooting steps that i could find, and I am currently on the last one, which involves making sure that the ports that iTunes needs to function are open on my computer. I followed the article that was telling me how to do this, found my ip address, and was on the step where you actually check the port. I was told to use the command telnet, but when i did, the command prompt told me that " 'telnet' is not recognized as an internal or external command, operable program, or batch file." So, I seem to be stuck. If someone could enlighten me on how to actually check if a port is open, or how to fix error code 11222, please let me know.

    Windows 7 may need telnet installed, as mentioned in http://technet.microsoft.com/en-us/library/cc771275(v=ws.10).aspx
    I think 11222 is actually support.apple.com/kb/TS4123. Is that what you see?
    I'm guessing you have one of the programs listed there and updating it may resolve.
    Tricky bit is some software is bundled with other software - like RealPlayer Plus bundles Speedbit.
    I hope that helps.

  • Ports not appearing in the command prompt

    Hi all,
    I have enabled the following ports in my windows 8 system using firewall. I opened the firewall.cpl and created rules both for inbound ports & outbound ports. The Opened ports are as below:-
    443, 25, 587, 143, 993, 995, 80, 3478,5061,5223.
    All the above ports are added in the firewall. But when I run the "netstat -an" command from the command prompt. The opened ports are not there.
    Can you please guide me why this is happening. I am clueless.
    Thanks for help.

    The command will only specify the active connections, not the ones that are opened. 
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • I am having mac book air 2012model i had installed mavericks and use it, i long press command and power button at a same time and i saw the command prompt, from that i had formated the total hard disk. how to i want to install the OS again ?

    I am having mac book air 2012model i had installed mavericks and use it, i long press command and power button at a same time and i saw the command prompt, from that i had formated the total hard disk. how to i want to install the OS again ?
    i tryed with download mavericks but finally its saying a error message like cant conect to istore like that its saying and every thing is clear like internet and other stuf i tryed with 3times no progress same error pls help.. i bought this lap for my bro with his apple id only we use it now he got a new mac book pro so he gave to me so i formated and use it i use my apple id is that problem come because of changing apple id ? pls eplain

    Firstly, what is the source of the 10.6.4 disc? Is it the original installation disc for your MacBook, or one 'borrowed' from another computer?
    It isn't the retail version, because that's 10.6.3.
    Assuming it's the correct disc (i.e. the one that shipped with your Mac), you need to boot from it again.
    OK the language page.
    From the installer screen, ignore the continue button, go to the menu bar and choose Disk Utility from the Utilities menu.
    In DU, select your internal drive in the sidebar (the top item with the makers name and serial no.).
    Run Repair Disk. If that comes up as disk OK, click the partition tab. Select the partiton from the drop-down above the graphic; 1 partiton is all you need.
    Go to the options button and ensure that the partition scheme is GUID and the file system to Mac OS Extended (Journalled). Name the partiton (usually Macintosh HD), click Apply.
    When the Macintosh HD volume appears below the drive name, quit DU and see if you can then install.
    If the screen after the language screen doesn't show the menu bar, it may be necessary to use another Mac to do the job with the MB in Firewire Target Disc Mode. If it won't boot in TDM, or the MB doesn't have FireWire then it's getting very difficult.

  • Code for how to read an integer array from the command prompt...

    hello,
    Could anyone give me the code for how to read an integer array from the command prompt...its very urgent!..

    If you are using a recent version of Java (5 or later) you can use Scanner:
    http://java.sun.com/javase/6/docs/api/java/util/Scanner.html
    That page has some example code on it, too.

  • How can we write the code for opening the command prompt and closing the

    how can we write the code in java for opening the command prompt and closing the cmd prompt from eclipse (cmd prompt should close when click on the turminate button in eclipse)

    rakeshsikha wrote:
    how can we write the code for opening the command prompt and closing theBy typing in Eclipse (which you seemingly have)?

Maybe you are looking for

  • Float value giving exception.

    Hi, I am using a bean for a shopping cart. I used this code public float getCost()           Enumeration enum=hashtable.elements();           String[] tmpItem;           float totalCost=0.00f;           while(enum.hasMoreElements())                tm

  • Problem in transporting WPC Content

    Hi,   I am facing  problem in transporting WPC Content from server1 to server2. After transport the webpages are not displaying the contents. Webpages are showing empty layouts. I have done the layout configurations. Webpages are cotaining iViews and

  • After running the recent update Iphone not detected by itunes

    After running the recent iOS update on my iphone4, itunes no longer detects my iphone when I plug into my USB port.  I ran the troubleshooter and got no relief.  The phone also charges much slower from the USB than it used to but still seems to charg

  • Shuffling Playlists in Mediasource for CDBurner (Tou

    Hi there! Can anyone tell me if it is possible to shuffle a large playlist (300+ tracks) easily without manually "dragging and dropping" the tracks up and down the playlist? I wan't to create a MP3 CD Burn list from Mediasource but don't wan't the tr

  • Problem mit der graphischen Anzeige der Frequenz

    Hallo liebes Forum, wir basteln gerade an einem Programm zur Strömungsdatenerfassung. Das Eingangssignal ist frequenzmoduliert. Es erscheint kein Signalverlaufsgraph für die Frequenz, obwohl die numerische Frequenzanzeige funktioniert. Außerdem wird