In any case the best is to put your code in a script and call the script in the good .profile
It might be better placed in the shells startup code, that is: ~/.kshrc or ~/.bashrc, depending on which shell thread-o/p is using. Unlike the .profile, which is run every time a user logs in, the rc-file is executed every time a shell instance is started. This will happen automatically whenever a terminal emulator, such as xterm, is started.
Is that literally what it said, and literally all it said?
Yes, that is.
Maybe I need to set environment variable? I don't know. I think first of all I should run the Script manually and then try to put it on start-up.
As I said I didn't have any .profile file, I create one manually on the root.
---------- Post updated at 07:00 AM ---------- Previous update was at 06:52 AM ----------
Quote:
Originally Posted by bakunin
It might be better placed in the shells startup code, that is: ~/.kshrc or ~/.bashrc, depending on which shell thread-o/p is using.
Thanks for your reply bakunin
But as I said the shell is sh shell not bash or ksh.
I condemn to use only and only sh shell!
Here you are:
This is for the case you get to your host by ssh...
In other words if you telnet , remsh or rlogin, the append in .profile is enough, if you get to remote via ssh, you will have to create if you have no file environment as I show you above.
By X means to correct .dtprofile to make it read .profile:
bottom of .dtprofile:
ADDENDUM:
Just read your last question: exec here I use exec since when the command script ends, the forked shell exits, and you find yourself at your login prompt... which I suspect is not what you want.
exec will make the forked shell, the current shell that will at exit end the session... as you can see on my first code trace above
Last edited by vbe; 06-07-2013 at 07:13 AM..
Reason: ADDENDUM
But as I said the shell is sh shell not bash or ksh.
You said you use "sh shell". This can mean one of two things: a POSIX shell or a Bourne Shell. If it is a POSIX shell you can set the variable "ENV" pointing to some startup file. This would be called every time a new shell starts. If it is a Bourne Shell, then you can use the startup option of the terminal: in case of "xterm" use the "-e" option to specify a program to be run at terminal startup.
when I run C:\cygwin\bin\run C:\cygwin\bin\startxwin.exe it fires up a terminal by default. Can I eliminate that terminal and start the x server as a service silently and sits in my status bar just there? Thanks Jack (0 Replies)
Hello.
Normally when you double click on the file name, the shell script start in background.
If you want to see what is going on, you must open a terminal console and start the shell within the terminal.
Is it possible to start directly a shell script in a terminal console from the file... (0 Replies)
Hello Guys
Please let me know how to solve the below issue
I have a file like below
drop table R1416.ABC1 cascade constraints;
drop table R1416.ABC2 cascade constraints;
drop table R1416.ABC3 cascade constraints;
drop table R1416.ABC4 cascade constraints;
drop table R1416.ABC5... (7 Replies)
Hello sir,
I want to monitor my work on the terminal.I know we can use script command.But every time when I start the terminal, I have to type script to start it.I want to automate it. So where should I include this command so that it will start as soon as I start the terminal ???? (2 Replies)
Hi all,
I am trying to write a script that launch the cisco vpn client from the command line and then connects to a remote host using ssh.
When i connect to the cisco vpn using vpnclient client connect the last lines of output from that client is
Encryption: 168-bit 3-DES
Authentication:... (0 Replies)
I have put the file descriptor 1 to file, using command exec 1>>out.txt
Then I could not see any output on the screen, how could I restore the default output to terminal? :mad: Thanks (3 Replies)
Hi everyone,
I'm pretty new using UNIX, but a friend of mine was helping me configure the unix terminal on my mac, and he changed some stuff on the bash profile .bash_profile. Everything was going well until I shut my computer and restarted it. When I opened the terminal this time this is what... (1 Reply)
hi
i want to know the way by which i put any file somewhere and it get s started when the system restarts or bots
i mean whenever my system starts that application must also start
thanks (3 Replies)
Hi,
How do I "run a script"?
I'm trying to start up some software called ElectroServer 3, and was told I just needed to "run the start script from the terminal to get things going".
From the terminal, i use cd command to change to the software's directory, and I guess the script in question is... (4 Replies)