General :: Unable To Setup PATH Using Shell Script?
Feb 14, 2011
I am creating one bash script name as pathsetup.sh.
In that , I am trying to setup a path to my user profile. S my script content is as follows,
pathsetup.sh contains,
#!/bin/bash
MY_PATH=/home/arun/NS3/ns-3.9/build
export PATH=$PATH:$MY_PATH
echo "$PATH"
If I run the script, when run time it shows the MY_PATH added to PATH.
But, when I check it in terminal after run, it doesn't add the PATH.
if I put echo $PATH in terminal, it show old path.
How can I add path permanently to a user.
I read, ~.bash_profile , we can add the path permanently for a user.
But, I want to add MY_PATH for a specific time. I don't want any user change the file .bash_profile each time.
Just running the pathsetup.sh script, MY_PATH should be added to the user PATH.
Instead of .bash_profile, using shell script, can it possible to add path permenetly for a user.
View 2 Replies
ADVERTISEMENT
Jun 11, 2011
I want to set up a PDC on my computer using Samba without LDAP, etc. The only thing I need is to share folders between the two ridiculous computers here. I got a 11.3 laptop and this 11.4 desktop. This is the /var/log/samba/log.smbd extract:
Code:
[2011/06/11 08:29:35, 0] lib/fault.c:250(dump_core_setup)
Unable to setup corepath for smbd: Permission denied
[2011/06/11 08:29:35, 0] smbd/server.c:1134(main)
smbd version 3.5.7-1.17.1-2505-SUSE-SL11.4-x86_64 started.
Copyright Andrew Tridgell and the Samba Team 1992-2010
[2011/06/11 08:29:35.951937, 0] passdb/secrets.c:73(secrets_init)
Failed to open /etc/samba/secrets.tdb
[2011/06/11 08:29:35.954910, 0] passdb/secrets.c:73(secrets_init)
Failed to open /etc/samba/secrets.tdb
[2011/06/11 08:29:35.955027, 0] smbd/server.c:1234(main)
ERROR: smbd can not open secrets.tdb
This is the /var/log/samba/log.nmbd extract:
Code:
[2011/06/11 08:27:48.682275, 0] nmbd/nmbd_become_lmb.c:395(become_local_master_stage2)
Samba name server ANTARES is now a local master browser for workgroup XXXXXXXX.WORLD on subnet
[2011/06/11 08:28:08.700572, 0] nmbd/nmbd_serverlistdb.c:343(write_browse_list)
write_browse_list: Can't open file /var/lib/samba/browse.dat.. Error was Permission denied
I have modified in Yast the User Authentication Source to smbpasswd and specified the correct path to the file...
This is the /etc/samba/smb.conf extract:
Code:
passdb backend = smbpasswd:/XXXXXXXX/smbpasswdfile
I erased all the samba related configuration files, uninstalled samba cli/ser samba-yast cli/ser and reinstalled, reconfigured and still have same issue. It worked very well with 11.1... (I clean installed 11.4 yesterday). I thought take sources from samba, compile and then see if it works...
View 4 Replies
View Related
Jun 1, 2009
I am trying for the last many days to setup my opensuse 10.3 as Samba PDC Server according to the URL mentioned below, but in vain:How to setup SUSE 10.3 as Samba PDC - openSUSE When ever I try to join a Windows XP machine to the domain setup on Opensuse, I get the error:'The following error occured while attempting to join the domain. The network path was not found'. What could be the reason for this error despite of the fact the I am able to ping the FQDN of the PDC from the XP machine, but the XP machine simply denies to join the domain because of the above mentioned error.
View 7 Replies
View Related
Jan 19, 2011
I modified files in several directories, and need to run a diff on the backup I created before modifying the file.
I'm trying to compose a simple shell script to speed up the task, but getting a syntax error.
Here is what I have:
for i in DIR1 DIR2 DIR3 DIR4 DIR5 do;
diff /maindir/subdir/subdir/$i/filename.txt.old /maindir/subdir/subdir/$i/filename.txt;
done
I know the paths are valid, and if I run just the diff command with the actual DIR1 instead of $i it works.
View 2 Replies
View Related
Jan 22, 2010
One of my colleague ran into trouble with setting up of path variable.
Earlier the entry for PATH in /etc/profile was:
Code:
Now what he mistake is:
He added a new Lines at the end as
Code:
Now due to this he is unable to run commmands now because that has overwritten the earlier PATH varaible.
If he types now:
It shows:
Code:
View 7 Replies
View Related
Jan 4, 2011
I've been looking around the net for executing a shell script. My basic understanding is that after setting executable permissions and providing a path (#!/bin/sh) in the first line of the script, I can type ./myscript to execute instead of sh myscript. This is not working for me. I can run "sh myscript" but not "./myscript" even though I know for sure I have across the board execute permission and my sh path is correct. I'm working on a redhat linux station.
View 6 Replies
View Related
May 13, 2010
We have two paths. First one is directory, second either dir or file.
/a/b/c and /a/d/e.txt
Relative path from first path to second will be: ../../d/e.txt
How to get it in linux terminal?
PS: For those who ask "what is use case?" - creating lots of relative symlinks (just as an example)
View 1 Replies
View Related
May 30, 2011
extract.ksh use this scripts topic_file_publish.sh but extract.ksh resides in /data/apps/pnbos/scripts
but topic_file_publish.sh in below directory/data/apps/pnbgstk/publication >
ls topic_file_publish.sh topic_file_publish.sh fraespappp8:/data/apps > type topic_file_publish.sh topic_file_publish.sh is hashed (/data/apps/pnbgstk/publication/topic_file_publish.sh)
How it is done?
since topic_file_publish.sh is being directly referenced in the code with absolute path.
View 2 Replies
View Related
Nov 28, 2010
I am new to writing shell scripts. So, please bare with me. I am currently trying to write a shell script which will read the directory path as input from user and will traverse the Dir tree to find all available audio and video files. I have tried to write as much as I could but I don't know where I am making mistake as I get some files to be audio file which are actully tar balls. On the second note there are some files which video but script shows them to be audio. And, some video files are completely skipped. I am giving the shell script below so that you can see. I am using two external files as source which I am attaching.
Code:
#!/bin/bash
#Let's load the extensions that we want to search for
vdExt=$(cat vdExtList)
adExt=$(cat adExtList)
[code]....
View 5 Replies
View Related
Dec 14, 2010
How can i write a shell script that takes a file path as command-line arguments.and it should report whether the path denotes a file or a directory.
View 2 Replies
View Related
Jan 16, 2011
I found the following function in /etc/profile file.
[Code]...
1. I dont undestand what "if ! echo $PATH | /bin/grep -qE "(^|:)$1($|:)"" this if statement actually comapres??
2. Also what is the difference between PATH=$PATH:$1 & PATH=$1:$PATH
View 14 Replies
View Related
Jun 8, 2011
I am unable to create either a file or a directory in a specified path in Linux.
I am getting the error "No space left on device".
I have checked with df -k and df -i. Free disk space is 28 % and free inodes are 28 %.
What else could be the reason?
View 2 Replies
View Related
Mar 24, 2011
I notice that my bittorrent client is capable of automatically setting up port forwards with my router, and I want to know if I can do the same in a shell script. The reason is, that since my router is stupid and won't let me keep static IP addresses (it seems they forced a DHCP refresh every week to make me want to pay for a more expensive model which doesn't), I need to get my computer to change the port forward to follow my computer's changing internal network IP address. I have a couple of port forward manually entered into my router settings for web interfaces to bittorrent etc, but of course these have a good chance of being invalidated at each DHCP refresh cycle.
View 1 Replies
View Related
Dec 11, 2010
i format and reinstall centos after that i create one sambha share and valid users restart smb service but i am unable to access it from windows pc shows network path not found any other service need to start
View 2 Replies
View Related
Jun 9, 2011
I inadvertently typed the wrong path when changing my user login shell and now every time I log in I get a message stating that it can't find the shell and boots me off the system. It will then redisplay the login prompt. I'm running Ubuntu Server x64 in VMware Workstation.
View 1 Replies
View Related
Oct 8, 2010
I use this command:
Code:
find ./ -atime +360
to figure out the files that haven't been accessed since 360 days. The command above will return results like this:
Code:
/uploads/2010/02/some-file-name.ext
/uploads/2009/08/another-file-name.ext
... etc
I'm taking here about tins of directories, thousands of files. I'm looking to find a command that makes me able to move the results above to another path, and to create that path once it doesn't exist like below:
Code:
mv /uploads/2010/02/some-file-name.ext /old-files/uploads/2010/02/some-file-name.ext
But I want the executed command to create this path
Code:
/old-files/uploads/2010/02/
If it doesn't exist.
View 6 Replies
View Related
Feb 21, 2011
I have a program that takes a relative path as input appends it to a some path string to get the actual path.
Now all I can input is the relative path. So if I want to go one level above my input will be ../mypath.
If I know the depth of the path used internally, I can use .. as many times to go to the root directory and then give the absolute path. But suppose I do not know the depth of the directory, can I construct a relative path string such that it considers it as a relative path. One way could be to have enough .. in the path string so that I can force an absolute path for some maximum depth of path.
Is there some path string syntax that I am not aware of but can achieve this?
View 2 Replies
View Related
Apr 26, 2011
Experimenting with shell variables, accidentally deleted the path variable how could I return to the original path value. What kinds of problems will I have if I don't have a path variable.
View 3 Replies
View Related
Sep 14, 2009
I have a path c:windowsackup I need this string to be changed into /windows/back/up I used the command -bash-3.00$ echo windackup | sed 's/\//g' but the output is windbackup
View 7 Replies
View Related
May 31, 2011
Current script:-
prefix=user@my-server:
find . -depth -type d -name .git -printf '%h�' | while read -d "" path ; do (
cd "$path" || exit $?
[code]....
How shall i go about changing the absolute path to relative path, so that /home/git/mirror/android/adb/ndk.git gets converted to /mirror/android/adb/ndk.git //echo <command> "$prefix$PWD.git" ?? - anything for relative path?
View 7 Replies
View Related
Jan 8, 2011
I edited /etc/profile to look like:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "`id -u`" -eq 0 ]; then
[code]....
When i type env, it just shows: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin It also shows JAVA_HOME, CLASSPATH and others were set up. Trying to get updatetool in glassfish usable for any user and during any session. I did the export command in a shell, and it worked, but not after closing the session. how to do environment variables.
View 3 Replies
View Related
Feb 2, 2011
How do i setup jde with emacs and how do i find my jdk path and verison to it?
Here the link i try to found.
[url]
View 1 Replies
View Related
Jun 14, 2010
Here's my scenario:
I want it so any inbound traffic from dsl goes back out the dsl and same for rogers. I've been searching and playing with many docs with no luck.
Anyone know how I do this? The multiple routes are on the same device br0. (which I think is causing all my havoc)
View 1 Replies
View Related
Dec 16, 2008
In RHEL5, the PATH of root is /sbin and /usr/sbin...., the PATH of common user has not /sbin or /usr/sbin, how to give the /sbin and /usr/sbin to a common user when he run command which sudo?
View 3 Replies
View Related
Oct 7, 2009
I'm new to UNIX scripting; I�m stuck with the following I have an Oracle SQL script that takes three parameters
1- File Name
2- File Path
3- File creation date
Under UNIX I have a folder where files will be placed frequently and I need to upload those files to Oracle, what I need is a UNIX script that can do the following
Loop through Directory "/home/applmgr/snktmp"
Picks only files
Pass the file name to parameter &1
[code]....
Is the above possible? I already knows how to call the Oracle Script from UNIX Im only stuck on writing the UNIX part where it List the files attribute(name,path,date) and store them to parameters ,Looping until the last file in the directory If the above is not possible,then how can I create the below from the command line
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
Filename{concatenation Mark}filePath{concatenation Mark}creationdate
View 4 Replies
View Related
Aug 9, 2010
mojo@mojo:~/Downloads$ sudo apt-get install gnome-shell
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following packages have unmet dependencies: gnome-shell : Depends: mutter but it is not going to be installed it asks for mutter, yet mutter is already installed. I think it asks for different version of mutter.
View 2 Replies
View Related
May 29, 2010
I think something has gone wrong with my attempt at setting up a new partition. I have two HDDs, initially one was divided into two partitions. I shrank the second partition using resize2fs from a live cd and am trying to create a third partition. I have been trying to follow this:[URL]
Here is the output of fdisk -l and df -h:
xebian:~# fdisk -l
Disk /dev/ide/host0/bus0/target0/lun0/disc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
[code]...
View 7 Replies
View Related
Aug 4, 2011
My MBP fails to boot Arch. This is what I did to install ArchLinux. Install rEFIT.
Partition using disk utility such that first one is Mac partition, second is Arch & the third ie the last one is windows.
Then put Windows 7 CD, select it from rEFIT and install it. Similar, install ArchLinux just as I did for windows.
Then finally to install the GRUB, I issued the command $grub-install --root-directory=/mnt/arch - recheck /dev/sda3 (after mounting my /dev/sda3 to /mnt/arch).
This is the exact error and then it drops to recovery:
Error after typing exit:
I have tried rootfstype too. No success.
My menu.lst (I have tried /dev/sda3 too):
View 2 Replies
View Related
Jun 3, 2010
I have downloaded the jdk-6u20-linux-i586.bin from their website. I also read the instruction given to install jdk manually but i was not able to run a single program. Can someone give a step by step instruction to install jdk and also tell me how to set the path so i can easily execute the programs.
View 9 Replies
View Related
Jan 21, 2011
I am Just trying to set the Environmental variable using a script file and my code is as follows:
#!/bin/bash
echo $PATH
PATH=${PATH}:/opt/bin
export PATH
echo Environmental Variable path is Set
echo $PATH
When I am running the above script, from the last line "echo $PATH" I am getting that /opt/bin has been appended to the PATH but again when I am typing echo $PATH in the terminal I am not getting the newly appended path.
View 3 Replies
View Related