[SOLVED] how to execute a command on xterm start

hi guys,
i want to execute a command each time i start xterm in that terminal itself.
i know about bashrc, but what I want to do is make it exclusively launch when xterm is started. when i want to use other terminals, e.g. terminology etc. i do not want that command to be executed.
has anybody an idea if that is possible (or possible with a different term)?
thanks!
Last edited by replax (2014-02-07 19:40:57)

slithery wrote:
You can either run xterm using the execute switch...
xterm -e command
This will only work if the "command" doesn't exit after executing, otherwise xterm will vanish in an instant. So use this to run programs, such as weechat, irrsi, etc.
Or add the command to your ~/.bashrc with a test to check that the current terminal is xterm, something like...
if [ $TERM = xterm ]; then
command
fi
This one is better suited for a command that behaves as mentioned above.

Similar Messages

  • How to execute unix command line from cocoa?

    how to execute unix command line from cocoa?
    for example, if I want to call "ping" from cocoa, how should I do it? and how can I obtain the return value?
    thank you.
    Power G5 Quad Mac OS X (10.4.3)

    The following article may also help:
    http://cocoadevcentral.com/articles/000025.php
    Mihalis.
    Dual G5 @ 2GHz   Mac OS X (10.4.6)  

  • How to execute a Command Prompt command from J2SE code executing on Windows

    How to execute a Command Prompt command from J2SE code executing on Windows??
    Please help me

    [http://java.sun.com/docs/books/tutorial/getStarted/]
    ~

  • How to execute Linux command from Java app.

    Hi all,
    Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
    Thanks a lot,

    You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
    If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
    You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
    java.io.BufferedReader br =
    new java.io.BufferedReader(new java.io.InputStreamReader(
    Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
    getInputStream()));
    while ((s = br.readLine()) != null) {...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to execute  make  Command?

      Run in the terminal inside the  make command,prompt:"-bash:make:command not found"  My system version is Mac OS X 10.7.3 Xcode Version is 4.3.
      How to execute  make  Command?
                                    thanks!!

    I switch to / usr / bin directory also did not find the make  only to find a makeinfo. Google to find relevant information, if installed Xcode will be able to run make, but now does not work.
    But still thank you very

  • How to execute Dos Command 'Pause' from Java ?

    How to execute Dos Command 'Pause' from Java ?
    I have read the article in javaworld for Runtime.exec() anomalies.
    Can someone please give an insight on this?

    Thanks Buddy!
    That was very useful. Even though its a simple
    solution, I never thought about that.Bullshit! Reread reply #7 of http://forum.java.sun.com/thread.jspa?threadID=780193

  • How to execute external command?

    How to execute follow command and get its ouput on linux ?
    $ grep processor /proc/cpuinfo | wc -l

    sabre150 wrote:
    nitelia wrote:
    String[] command = {"sh","-c","grep processor /proc/cpuinfo | wc -l"};
              Process pro = Runtime.getRuntime().exec(command);
              BufferedReader bf = new BufferedReader(new InputStreamReader(pro
                        .getInputStream()));
              String x = null;
              while ((x = bf.readLine()) != null) {
                   System.out.println(x);
         This should workWow! So all one has to do is to use a shell to run the command! Isn't it a pity I did not give this solution in reply #3?You old sabre rattler! ;-)

  • How to Execute shell commands in OSB

    Team,
    My Requirement:
    I have two sftp servers name ServerA and ServerB. Need to copy files from ServerA and place it on ServerB and change the file permissions to 777 after placing the files.
    The user i am connecting to ServerB has the access to override file permissions.
    Steps
    1. With help of FTP adapter in OSB I am reading files from ServerA and writing on to ServerB  -- Completed and is working.
    2. How to override file permissions after placing the file ????? -- Yet to implement.
    Please suggest me how can i accomodate 2nd step.
    Thanks,
    Suman V.

    If by "execute shell commands" you mean actually
    running a shell process (as opposed to just forking
    and executing specified programs) then I'd advise
    against it. The last thing you want is for the
    clients to be running arbitrary commands on the
    server. You don't want to make it possible for the
    client to run "rm -fr /" on your server.Right.
    I was assuming (perhaps with more optimism than is really warranted) that the OP was going to be in complete control of which commands were executed--that there'd be a small, fixed set in response to certain user actions.

  • How to execute unix command through odi and store the result in table

    I have to reconcile  if data is loaded in table from csv file or not . I have to create a oracle data integrator package/interface/procedure to execute unix command to count number of rows in the csv files and store the count result in a table then i have to query the loaded table and count number of rows there and store in the table and have to compare is counts are same or not,  Please assist me how to make package/interface/procedure to  execute unix command and store result in oracle table.
    Thanks in Advance

    Use ODI OS command tool in the ODI package.
    create an interface in ODI using LKM File to Sql and the output file generated with the csv file's row count as a source and the db table(where the count needs to be stored) as a target

  • How to execute unix command in plsql block( urgent)

    Hi All,
    i want rename the unix folder to New name on update non_employee table . So, please give me idea how to use unix command here.... Please suggest me ASAP ... Its urgent
    CREATE or REPLACE TRIGGER NON_EMPLOYEE_AftUpd_trg
    AFTER UPDATE ON NON_EMPLOYEE
    FOR EACH ROW
    BEGIN
    IF :new.DIST_LIVELINK_PATH <> :old.DIST_LIVELINK_PATH THEN
    rename unixfolder1 to :new.dist_livelink_path.
    end IF;
    END;

    The solution will depend a lot on your Oracle version, which you forgot to mention ;)
    btw shouldn't that be (in pseudocode)
    rename :old.dist_livelink_path to :new.dist_livelink_pathotherwise it will always fail after the first time?
    In Unix that would require the mv command.

  • How to execute dos command in Java program?

    In Perl, it has System(command) to call dos command.
    Does java have this thing?
    or any other way to execute dos command in java program?
    Because i must call javacto compile a file when the user inputed a java file name.

    Look in the Runtime class, it is implemented using the Singleton design pattern so you have to use the static method getRuntime to get its only instance, on that instance you can invoke methods like
    exec(String command) that will execute that command in a dos shell.
    Regards,
    Gerrit.

  • How to execute unix command from ODI Procedure

    Hi,
    I am trying to execute below unix command from ODI Procedure (Command on Target tab) but I am getting the error "java.io.IOException: Cannot run program "cd": error=2, No such file or directory" but when I try to execute the same command using OdiOSCommand, it is executing successfully. I don't want to use shell script to execute this command. Is there any specific syntax am I missing to execute this command from ODI procedure?
    cd /project3/tmt/;ls *.dmp > dmplist.lst
    Please help me on this...
    Thanks
    MT

    Hi nahlikh,
    Thank you for the reply.
    I used below command in Procedure but still getting the same error as "java.io.IOException: Cannot run program "OdiOSCommand": error=2, No such file or directory".
    OdiOSCommand "-COMMAND=cd /project3/tmt/;ls *.dmp > dmplist.lst"
    as I mentioned earlier if I use the command cd /project3/tmt/;ls *.dmp > dmplist.lst in OdiOSCommand tool it is executing successfully without any issues.
    any thoughts appreciated to get a solution for this issue.
    Thanks
    MT

  • How to execute system command from java program

    Hi all,
    I want to change directory path and then execute bash and other unix commands from a java program. When I execute them separately, it's working. Even in different try-catch block it's working but when I try to incorporate both of them in same try-catch block, I am not able to execute the commands. The change directory command works but it won't show me the effects of the bash and other commands.
    Suggestions??

    The code I am using is....
    try
    String str="cd D:\\Test";
    Process p=Runtime.getRuntime().exec("cmd /c cd
    "+str);your str string is already having cd in it but again you ar giving cd as part of this command also please check this,i will suggest you to remove cd from str
    Process p1=Runtime.getRuntime().exec("cmd /c mkdir
    "+str+"\\test_folder");you should say mkdir once you change your path,but here you are saying mkdir first and then cd D:\Test(this is because of str)..please check this
    Process p2=Runtime.getRuntime().exec("cmd /c bash");
    Process p3=Runtime.getRuntime().exec("cmd /c echo
    himanshu>name.txt");
    catch(IOException e)
    System.err.println("Error on exec() method");
    e.printStackTrace();
    Message was edited by:
    ragas

  • How to execute sqlplus command in bat file ?

    Hello
    I have a simple script file that looks like this:
    "sqlplus admin/admin as sysdba
    shutdown immediate"
    But.. when i start this file.bat my system logs but do not make any script. Sqlplus just waiting for command, and when i write "exit" i logout from sqlplus, and then system execute next command, that is "shutdown immediate" but beyond sqlplus (so my base is still working). Is it at all possible to log on and execute commands from file.bat or some other way ?
    I'm using oracle 11g, windows 7x64
    Regards and thx for help
    Edited by: 879529 on 2011-11-27 04:52

    969970 wrote:
    Thank you that worked for me.But I fear you don't really understand WHY it worked, and WHY your first attempts did not work.
    So let me explain
    Given this .bat file
    sqlplus / as sysdba
    shutdown immediateWhat happens when you execute the file? The windows command processor reads the file line by line and processes the command on each line. What is the first lilne?
    sqlplus / as sysdbaSo what would you expect to happen when Windows processes that line? Remember, it's exactly as if you had entered that command yourself at the command prompt .... Answer: The OS locates an executable file named 'sqlplus', loads it into memory and passes control to it, along with a pointer to the rest of the command line ('/ as sysdba'). At that point, the executable sqlplus has control and will do whatever it wants with the command line it was passed ('/ as sysdba') and then waits for user input for more commands, including an 'exit' command. Where are those commands going to come from? They are NOT going to come from the next line in the bat file. They can't. The command processor that is running the bat file is still waiting for sqlplus to finish and return control. So you are stuck. The only way out is to break out of sqlplus with a 'ctl-break'. Once that happens, the command processor moves on to the next line in the bat file:
    shutdown immediateSo now the os tries to locate an executable file named 'shutdown' .... you probably don't have an executable by that name (let's hope not!) so you then get an error message from the OS informing you that
    'shutdown' is not recognized as an internal or external command,
    operable program or batch file.Now, if you were using a real OS, you could achieve what you wanted by using input redirection, but unfortunately, Windows just has a toy for a command processor.

  • How to execute a command periodically?

    hi
    well it may seems so silly to ask such question ,but i am a beginner.
    I want to execute a command ,i mean printing some text every five minutes without any loop.I mean using some kind of interrupt or so.So my processor has got time to do other jobs.
    I would be glad if anybody could give me a clue,so i know where to start from.
    BRs
    saeed
    Edited by: zaec on Oct 27, 2008 1:54 AM

    But I have got another problem ,suppose I have got 3 different threads which are going to be done as follow:
    thread one-----every 5 seconds
    thread two-----every 7 seconds
    thread three--every 10 seconds
    Now ,if thread one,as an example,take more than 10 secondsand by now thread 2 has passed its 7 second what happens.does thread 1 stops at its 7 seconds and thread 2 starts,or thread 1 doesnot give the control to anyother thread till it is finished.By the way i use sleep() method to give the control to other threads.
    sleep looks like a good way to ensure that other threads get a chance to execute.
    As for what happens to concurrent threads when a particular thread is running -- as far as I understand, Java machine specification does not mandate strict "rules of the game" here. I wouldn't be surprised if things differ on different devices.
    More details on multi threading in Java are available in 9-part series of articles in Java World: *"Programming Java threads in the real world"*. You can find these articles with search at Java World site: [click here for search results|http://www.javaworld.com/ifind/java/query.html?col=java&qt=Programming+Java+threads+in+the+real+world]

Maybe you are looking for

  • Warning iOS 7 knows if you use after market charger

    Says this accessory is not authorized or something.  Try the 30 pin to lightning adaptor doesn't work now

  • Using temporary tables in stored procedures

    Suppose that I have created a temporary table in a stored procedure using an "EXECUTE IMMEDIATE" statement. When I compile the procedure, that table is not created yet, so the compiler says that the table does not exist. What is the way of using temp

  • Data Table with DBDatasource

    Hi, I have a grid with a DT linked to it. I need to add columns to this DT with DBDatasourse is set in each column. So that, using UDO I can save the data to the Line table. Please add some sample code for this to be done Thank You

  • 2 users on imac27

    2 users on imac27 with only one account though. When we bought the Mac the shop used one e-mail as the ID, now everything is combined.  a. We want to have seperate accounts How do you do it? b. All of my contacts and my wife's have been combined on e

  • BW251 - TECHED03

    Hello This message is to locate a document on SDN SERVER: URL - https://www.sdn.sap.com/irj/sdn?rid=/webcontent/uuid/1ac0fd6b-0501-0010-a49e-d05f069e6c37 [original link is broken] I am seeking Abtract of session BW251 termed - Balance Sheet and Profi