General :: How To Replace The Path

Feb 16, 2010

I added a path in my bash_profile so that I could use the executables in the directory (I thought). But it turned out some other directory has the same executables and the path had already been added by the previous user. Is there way to overwrite this path? I can't find where that old path was added.

View 10 Replies


ADVERTISEMENT

General :: Command Line - Can Add A Shortcut To Replace A Path

Jul 24, 2010

For example, I always go to this path:

/user/something/somefolders/somewhere

but I don't want to type

cd
/user/something/somefolders/somewhere

in the terminal all the time, can I have some short hand to do so? for example, can I do something like

cd commandPlace

to replace the path?

View 5 Replies View Related

General :: Replace A String In A File Using A Script With Path Containig /

Feb 26, 2010

I need to replace a string in a file(startup.sh) using a script(parser.sh). After running parser.sh startup.sh should be filled with nfs path like /home/vimal etc but im getting error since path contains /. how to remove this.

View 3 Replies View Related

General :: Replace String With Empty String Of Dir Path ?

Apr 2, 2011

I want to replace a string of directory path in a string to empty:

Code:

But this doesnt seem to give me the desired thing:

Code:

This gives the desired outcome, but its specific, i need a variable in the sed not a string. And if I replace STRING="/mnt/sda1/record/$dd/" then I cant use it for something else, cause its has all the weird backslashes now.

View 3 Replies View Related

Programming :: Replace The Default Path In A File(which Is A Script)?

Jul 19, 2010

I am trying to replace the default path in a file(which is a script)with the new path which I have get when the bash script runsThe code is

SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
sed -i "s/$HomeDir/$SCRIPTPATH/g" <filename>

[code]....

View 4 Replies View Related

General :: Difference Between PATH=$PATH:$1 & PATH=$1:$PATH?

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

General :: Replace Function Replace More Than One Word With The Same Character(s)?

Apr 23, 2011

Can the Replace function replace more than one word with the same character(s)?

Also, do you know how to access the plugins provided by the gedit-plugins package?

View 3 Replies View Related

General :: Move A File To Some Path And Create That Path When It Doesn't Exist?

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

General :: Forcing An Absolute Path Where A Relative Path Is Expected

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

General :: Deleted Path Variable - How To Return To The Original Path Value

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

General :: Change Windows Path To Unix Path?

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

General :: Change Absolute Path To Relative Path?

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

General :: Command Path Is In PATH But Bash Does Not Find The Command

Jul 12, 2011

kernel 2.6.21.5, slackware 12.0
GNU bash 3.1.17

Code:

As you can see, /usr/local/bin is in the path. However, bash does not look for nasm in /usr/local/bin.

If I am root, things go well:

Code:

View 16 Replies View Related

Programming :: Java Applet Not Loading Image With Relative Path But With Absolute Path / Resolve It?

Jul 17, 2009

Java applet not loading image with relative path(e.g. images/1.jpg) but loads image with absolute path(i.e. from /root/user/images/1.jpg) . This is a problem when i want to host the applet on web server

View 2 Replies View Related

Red Hat / Fedora :: Appending A Path To PATH Variable Permanently?

Oct 21, 2010

how to add a path to PATH variable permanently so that it remains persisent even after closing shell and rebooting the system when i added a path, to variable it remained there as long as i didn't closed the shell. but when i reopened it ,changed were undone.

View 2 Replies View Related

SUSE / Novell :: Add Path To $PATH Variable?

Apr 19, 2009

I am trying to figure out how i can add the path /usr/sbin/ into the $PATH variable. I want this to be used from the normal account. I am bored settinh this manualy each time my computer starts.

View 2 Replies View Related

General :: Replace The Old One.o With The New One.o?

Feb 15, 2010

I am having problem with the ar cmd. I had already created an archive archive.a with two .o files but I have modified one of them now. How do I replace the old one.o with the new one.o?

I used the ru cmd but it is not working. I don't think I am properly using it, this is how I have it so far:

ar ru archive.a one.o. But this is not working.

View 1 Replies View Related

General :: Replace All The C's And C's In It With %1?

Nov 13, 2010

I have a document. I want to replace all the c's and C's in it with %1 all the f's and F's in it with %2. i can get sed to do one of them but for some reason i can't get the script to do all the conversions at once.

View 4 Replies View Related

Fedora :: Add Path In .bashrc By Commenting Out Old Path And Adding New One - Command Source ~/bashrc

Jun 14, 2011

When I add some path in .bashrc by commenting out old path and adding new one like this:

#EXPORT HOME_PLAY=/home/gem/old_play
EXPORT HOME_PLAY=/home/gem/play
EXPORT PATH=$PATH:HOME_PLAY

After saving above changes, I enter the command: source ~/.bashrc Now if I do echo $PATH, the path shows both the old PLAY_HOME and new PLAY_HOME. This is really bad and messes up a lot of things in my project. This problem only goes away if I logout or reboot, a rather very long process. What is happening is that the old path is added to new path element and the old path includes the old path element you want to remove.

View 10 Replies View Related

Programming :: Can I Get Absolute Path Without Giving A "path" But Inode Number By C

Aug 13, 2010

Does anyone know how to get the path with a inode number by C programming?
Or can I get the absolute path without giving a "path" but a inode number by C?

like this: get_path(unsigned inode);
not such this function: getcwd(".", xxx);
taowuwen@gmail.com

View 7 Replies View Related

General :: Search And Replace /'s In VI

Feb 7, 2010

I was wondering how I would search and replace all /'s with -'s in vi. %s///-/g doesn't work obviously.

View 2 Replies View Related

General :: Making RPM Replace Another One

Jul 12, 2011

I want to make an rpm which when installed as an update causes another rpm to be removed. I'm fairly sure this is possible because I have seen LibreOffice rpms install as updates replacing OpenOffice rpms in the process without any interaction being required. However I'm unable to figure out how to do it, even after having looked at the spec file for such a LibreOffice rpm.

I have package gstreamer-0_10-ffmpeg installed. I have another package called multimedia installed. I've built a new version of multimedia which includes the gstreamer ffmpeg plugin so I don't need the gstreamer-0_10-ffmpeg package installed any more. I've tried using Provides and Obsolete in the spec file of the new multimedia package. E.g.

Code:
Provides: gstreamer-0_10-ffmpeg
Obsoletes: gstreamer-0_10-ffmpeg <= 0.10.10
(I've tried it with and without version numbers.) Whatever I put in the spec file, when I try and install the new multimedia package as an update zypper says

Code:
$ zypper up -y multimedia
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: multimedia-1.1-1.i586 obsoletes gstreamer-0_10-ffmpeg <= 0.10.10 provided by gstreamer-0_10-ffmpeg-0.10.10-0.i686
Solution 1: replacement of gstreamer-0_10-ffmpeg-0.10.10-0.i686 with multimedia-1.1-1.i586
Solution 2: do not ask to install a solvable providing multimedia > 1.0-2
Selecting an option manually is no good, I need the update to happen without user interaction.

View 3 Replies View Related

General :: Find Or Replace Without Using Sed?

Dec 27, 2010

I am working on writing a script for find and replace a string using sed.But know I want to write without using sed.

View 9 Replies View Related

General :: Replace Everything Before @ Symbol?

Nov 13, 2009

I have a list of email address's that I need to sift through to identify only the domain name.

xyz@yo.com
abs@yo.com
clahclah@test.com

I want to remove everything before the @ symbol and only print the domain name. Can anyone assist with this?

View 8 Replies View Related

General :: Replace The () With Xxxx?

Dec 29, 2010

I have a sed question

I got the following

(12121) and I want to replace the () with xxxx

so the output would be

xxxx12121

I am using the following but its not working

sed 's/(.*)/xxxxxx/g' TMP4 > TMP5

View 6 Replies View Related

General :: Sed Replace String Up To Tab

Dec 12, 2009

I'd like a sed command to replace all decimal values greater than 0.5 with nothing in a tab delimited text file.

EX:

There would be one tab before 0.301 and two tabs after it. This way when you paste the text into an excel spreadsheet, there are empty cells where you deleted values.

I thought the sed command would be something like:

But this will delete everything.

What I need is something that will start deleting when it sees 0.[5-9] and stop when it reaches a tab. I know you can use [^character]+ to do this, but it doesn't seem to work with a TAB as the character.

Another idea I had would be to have sed replace from 0.[5-9] to 0. and replace with a tab + 0. But I also cant get [^0.]+ to work as it only works with single characters.

View 14 Replies View Related

General :: Sed To Replace First And Second Instance?

Jul 17, 2011

I might just be crazy or particularly dumb today but what I'm trying to do is have sed replace the first and second instance of a character on a line but not after that.

Basically it is a csv file with a date formatted as dd/mm/yyyy and I need to completely remove the slashes. No problem using:

Code:
sed 's////g' < file > outputfile

The only problem is that one of the columns after this may also contain these slashes and shouldn't be removed.

I must have read every single sed page on the net today to find a way to do it to no avail! Is it as simple as :

Code:
sed 's////1' < file > outputfile

And then run the same on the output file again? these two slashes will always be the first and second slashes in the file.

View 6 Replies View Related

General :: Samba File Permissions For Multiple Groups In The Same General Path?

Nov 4, 2009

I'm using my Linux (SLES 10) server as a File Server at this point. I need to set File Permissions to nested folders differently to different groups. For example:

homesharedengineering* should be read only for groupA
homesharedengineeringadmin should be read & write for groupB Plus read only for groupA
homesharedengineeringautocad should be read & write for groupC Plus read only for groupA

I've been using Webmin and Putty to set permissions but Putty only allows me the Default Group, it won't allow me to set several groups on the same directory. Webmin seems to allow me to add multiple groups (Webmin --> Others --> File Manager --> Info & ACL tab will provide extended abilities) but when I add multiple groups, they don't seem to take effect? I'm wondering if my setup at the 'Share' level or at the hierarchy of my folder structure (unix based) needs to be set specifically?

View 1 Replies View Related

Fedora :: 12 And VMTools - The Path "" Is Not Valid Path To The Gcc Binary

Mar 23, 2010

running Windows 7 64bit with VMware Workstation 7.01-build 227600. I have some knowledge of Linux, I have installed f12 and have updated the system as of 03/22/2010. All updates completed successfully.

1) How do I install VMTools on the f12 (after mounting the CD/DVD tool package)

2) How do I update the gcc files it says are dependencies?

Here's what I get on installation:Before you can compile modules, you need to have the following installed...

make
gcc
kernel headers of the running kernel

and then I am prompted for this input from the install script:

Searching for GCC...
The path "" is not valid path to the gcc binary.
Would you like to change it? [yes]

and this is where I get stuck. How do I get around this or satisfy the requirements for the install?

View 5 Replies View Related

General :: Replace Multiple Spaces By One Tab

Feb 2, 2011

Ive some textfiles which contains some colums seperated by a various number of spaces, but instead i need one single tab as a seperator.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved