I am having two files, the content of first file (out.bash) is
Second file content (out2.csh)is
When I run in Ubuntu, i am typing bash out2.csh,
the output display is
I am just wondering why my current directory is not changed to /home/jessy/abc path?
2. If i am running the script from command prompt like
, my path will be changed to /home/jessy/abc
3. What is the "start" equivalent command in Linux? I wish it can work like WIN dos's start command so that it can direct the folder to the path that I have specified.
ad 1: It's not changing the path because the cd is run in the context of the shell script process, which does not influence the interactive shell process.
ad 2: See above. If you manually source the file, its commands are run in the context of the current shell, thus the path change
ad 3: Huh?
Generally: please start using [CODE] tags for script listings and similar.
That means I don't have any method that can call a script file to change my directory? In Win DOS, we can write a bash file, for example like abc.cmd where abc.cmd will change my directory , for instance from c:\jessy\jessy2 to c:\jessy. We can just simply call abc.cmd in order to to the task?
2. In Win, as long as I set my environment path, I can easily run abc.cmd in whatever directory I am in? How about in Linux, is there any environment path for me to set up so that I can run my shell file irregardless of my path?
3. Regarding the start command, for example, my current path in my command prompt is C:\Document_and_Setting, when i run start. command, it will open a new window for me and I can easily access the files which are stored under C:\Document_and_Setting.
4. Is Linux having this command? set DISPLAY jessy:0.0? I am just wondering why I can't run this command in my Linux?
5. Is Linux having WIN's equivalent command - title ? I wish to change title for every different console?
Thanks. Sorry I am indeed very newbie in Linux.
Thanks.
Not with a shell script. That's what aliases, functions, etc.. are for, eg. alias goproj="cd ~/projects"
Put that in your .bash_profile (if you're using bash). Don't know the equivalent for (t)csh.
Same. Take a look at $PATH
Is it opening a file manager window, or a new command line window? For the former, that would depend on your WM. For the later, xterm& should work in any WM.
That's (t)csh syntax, and won't work with bash, ksh, or zsh. The appropriate command for those is export DISPLAY=jessy:0.0
No special command for that. Some terminal emulators support the use of ANSI control characters for that, but it's not guaranteed. This has been discussed before, so please search the forums for more information
Thanks for the reply.
I had tried for 1,2. It works. Thanks.
For 3, start. in WIN will start a new file manager window.
For 4, I am not that sure for this. However, I will have a look at what your suggestion is. I need to correct my previous command, it is setenv DISPLAY jessy:0.0.
For 5, ok. Noted. I will browse through it.
By the way, what does it mean by ./ ? I always encounter this like source ./abc.bash and ~/path ?
Thanks.
How to start a new instance ("new window") of the file manager depends on your WM, and what file manager is used. Could you post that information?
set variable value and setenv variable value are both (t)csh syntax. You can use the alternative I've given in both instances.
./ means "use the current directory". As a safety precaution the PATH variable in Unix doesn't usually include the current directory, unlike Windows. So to run a program or script from the current dir, one has to explicitly state that. That way it's harder for someone to plant a malicious program called (for example) ls.
~, when used in a path, is shorthand for the current users home directory.
For the .start or start command in WIN, I am not sure whether I had described wrongly or not. It will start a new window explorer.
For the set in Linux, what does this mean?
I have two doubts here,
a. Is the $cwd in Line 2 refer to the same as in Line 1?
b. In Line 2, what does the cd \!* means? !*
Hi everyone,
I know the following questions are noobish questions but I am asking them because I am confused about the basics of history behind UNIX and LINUX.
Ok onto business, my questions are-:
Was/Is UNIX ever an open source operating system ?
If UNIX was... (21 Replies)
Dear friends,
I am using SCO Openserver 5.0.7.
Where does the ps -ef command pick the information from? Is it stored in some file?
Also, the ps -ef command or the ps -eo args command displays truncated information. How to get the complete expanded output without truncation?
Thanks in... (8 Replies)
Hello,
I have created a script that changes directories but in order for it to work I always need to invoke a source ./script
Here is a copy of my script.. if I do not invoke "source ./script" the change directory command does not work.
Any ideas?
//
The script is pretty basic
... (1 Reply)
Do you have the source code of UNIX?
If yes, can you please send it to me on my email
email address deleted
For your this help I shall be obliged to you.
With Regards
rajesh
***phone removed*** (1 Reply)
Discussion started by: rajesh_ranjan26
1 Replies
6. Post Here to Contact Site Administrators and Moderators
Ive written a script that uses the source command but i get the error:
source: not found
when i enter it myself manually it works fine, is there any reason I cannot use this command in a script? (2 Replies)