Dear all,
For setting up my working environment, I need to source some files. What i usualy do is to do it manually,
it take care of everything and I am able to run the commands like
.
As it was manual task every time, I defined this in .bashrc itself like
Now, I source the .bashrc and tried using the command, root for example, but it was failed to run.
Any piece of suggestion would be great.
You seem not to use bash or ksh at all, but in fact zsh. To use a script for one shell (.bashrc is for bash, as the name suggests) and let it run in another shell (zsh) may work - especially when the shells were built with compatibility in mind, like bash and Bourne Shell or Korn Shell and Bourne Shell - but doesn't have to at all.
Further, you use a command named "root" which is not a standard command i am aware of at all. Issue a
and use "ls" and "file" to find out if it is a link, script, or whatever. Depending on your system and shell you might have to substitute "whence" or "whereis" for "which". For example:
So the file "blabla" in my "$HOME/bin" directory is a link, linking to an executable program named "/usr/bin/ls".
I hope this helps.
bakunin
/PS:
Quote:
Originally Posted by emily
I defined this in .bashrc itself like
First, the "export" keyword and a variable declaration should not go on the same line:
Second: The content of the "ENV" variable tells the bash executable which configuration file to use at startup. When you execute ".bashrc" bash is already starting so this telling happens at a point in time when it is already useless.
You could place the "ENV=..."-line in your "~/.profile", but then your normal .bashrc would not be executed at all (instead "/setup/setup.sh" would) and this is probably not what you want. The correct way to to this is to first add the following lines to yor profile (per default "~/.profile"):
Then, you add the following line to the file "~/.bashrc":
The leading "." (notice the space between it and the command) will do the same as the command "source" - it will execute every command of "/setup/setup.sh" in the current environment without opening a subshell, so every change to the environment this script makes stays when it exits.
Depending on what you want you can put this line to the end - then it will override every setting you did before if they coincide - or at the beginning. In the latter case it will provide a "base environment" which you alter for your personal purpose with the rest of your "~/.bashrc".
Dear all,
For setting up my working environment, I need to source some files. What i usualy do is to do it manually,
it take care of everything and I am able to run the commands like
.
As it was manual task every time, I defined this in .bashrc itself like
Now, I source the .bashrc and tried using the command, root for example, but it was failed to run.
Any piece of suggestion would be great.
thanks,
emily
Hi Emily,
Not 100% sure but we can create a shell script as follows.
This will not permanently set PATH environment in your system. To set it permanently you can edit your .profile.
You can try this in a non live(testing) environment.
Hello,
I have to write a script to compare the sum of the amount fields in a source file and the amount field in another file.
details are:
based on the name of the source file (say SALES as an example), a file already available in a path will be grabbed (say SALES_ParmFile) and this file... (4 Replies)
Hi all,
I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example:
... (2 Replies)
I need to
"Ensure that when you download libchat.a from the VLE you have copied it to the same folder on ius as your source files. You then refer to the library (and the libraries it needs) with:
gcc -o outputfile sourcefile.c -L. -lchat -lsocket -lnsl"
But I have no idea what this means! (I... (2 Replies)
hi all,
Please help me with rsync.
I configured rsync to preserve timestamps using the -a option.
When i renamed fileA to fileB on source machine I have to copies at the backup server.
The aim is to keep the most recent file.
fileA & fileB has same contents.
When i renamed fileB to... (2 Replies)
Hi experts,Please help me for the below requirement. i have a source file.(lets say contains 50 columns). I am extarcting five columns from the source file by using pattern file. for example input file:--------a,b,c,d,"a,g","v b",s,koutputfile=======a,"a,g","v b",s,kThanks in advance subhendu (2 Replies)
hi experts
lets say my format file is B
B
=========
column no,name,type,length
1,ee,N,12
3,hj,N.4
4,kl,N,5
source file
========
d e f g h i
5 8 9 7 6 5
1 3 4 5 6 6 (2 Replies)
This is shell programming assignment.
It needs to create a file called .std_dbrc contains
STD_DBROOT=${HOME}/class/2031/Assgn3/STD_DB
(which includes all my simple database files)
and I am gonna use this .std_dbrc in my script file (read the data from the database files)
like this: .... (3 Replies)
Hi there Everyone,
I need some help/information/advise for the following questions:
I'm writing the following script:
#Beginning of the script
ftp -n <source server> > ${log_dir}/test_get.log << END
user <user_name>@<IP Address> <passwd>
verbose
bin
!echo "'List Files Before Getting... (3 Replies)