Inspired by the accepted answer to this thread, I am trying to replicate a similar construction in tcsh (version 6.14.00) with no luck:
setenv new_PATH (
/some/path
/some/other/path
# Some comments
/foo/path
# Another group
/bar/path
$PATH) # Attach $PATH at the end in case we had previous declarations
setenv PATH `sed -e '/^#/'d -e '/^$/'d << EOF | paste -d ":" -s $new_PATH`
I get th
Hi.
I'm trying to get the names of files from a log file, without the path and special characters.
I have a file that contains lines like this:
Code:
'/path/to/files/file00010000070874.EXT'
'/path/to/files/file00010000070875.EXT'
'/path/to/files/file00010000070876.EXT'
'/path/to/files/file00010000070877.EXT'
'/path/to/files/file00010000070878.EXT'
'/path/to/files/file00010000070879.EXT'
'/p
I would like to use sed to convert a path with backslashes to the same path with forward slashes:
E.g.
I would like to pipe \\path\to\file\ and obtain /path/to/file
None of the following commands work, and I can't tell why:
First attempt:
> echo '\\path\to\file\' | sed 's/\\/\//g'
/path o
ile/
Second attempt:
echo \\path\to\file\ | sed 's/\\/\//g'
/pathtofile
Third attempt
So I am using CentOS 6.3 a fresh install and I was trying to add things to my path for OpenMPI so I edited my .bash_profile file to read:
FOO='test'
export FOO
# Add support for MPI
PATH=$PATH:/usr/lib64/openmpi/bin
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
Which apparently isn't being read when I start up a bash shell, my $PATH is without the /usr
I do know how we set the PATH variable-
Code:
export PATH=$JAVA_HOME/bin:$PATH
I'm trying to understand why we have written
Code:
:$PATH
in the end above statement. What is it's meaning?
Say I do the following:
cd /some/path
ln -s /target/path symbolic_name
If then do:
cd /some/path
cd symbolic_name
pwd
I get:
/some/path/symblic_name
and not:
/target/path
Is there a way to have the shell "fully resolve" a symbolic link (i.e.
I want to automatically add a new path to the $PATH variable each time when my RPM package is installed.
I tried to use a post installation script in the my RPM.
Here is the part of RPM spec file containing this post installation script:
%post
PATH=$PATH:/usr/app/mdg/bin
export PATH
But after successful installation the $PATH doesn't changed.
Please help me with that issue.
I used the command:
PATH=$PATH:/opt/lum/ls/os/linux/bin/;export PATH
in terminal to add that path to the path command, but every time I leave the terminal window and check it again with
echo $PATH
It is no longer in there.
i want to write a C program to append a string to PATH Environment variable.
something like "export PATH=$PATH:$HOME/mylib"
i have C code like this
setenv("PATH", "$PATH:$HOME/mylib",1); //which does not work.
other work arround i thought was get PATH and HOME using getenv() and create a memory in heap then append them using strcat().
I might have to update PATH many times in my code: so th