I have a list of relative paths such as this:
dir1
dir2
dir2/dir3
dir2/file1
dir3/file2
dir3/dir4
dir3/dir4/file3
In the example above, the specifier dir2/file1 (for example) is redundant, because the dir2 entry would include this file.
Want I want to do, essentially, is remove redundant paths from a given list of paths.
Hello experts,
I am exploring parameter expansion, and trying to cut the fields in a URL.
Following is the requirement:
I have
// abc.nnt /dir1/dir2/dir3/dir4/somefile.java
What i need to get is the path after dir3, and dir3 will be passed.
output that i need is dir4/somefile.java.
I am trying to use like
path="https://abc.com/dir1/dir2/dir3/dir4/somefile.java"
sho
I have many files that i want to move into folders, their names are something like this dir1/dir2/dir3/name_of_file.ex and then maybe another is called /dir4/name_of_file2.xe
Is there anyway of moving those files into the directory dir1/dir2/dir3 and change the name of it to only name_of_file.ex automatically?
I really don't know how i can explain it easier..
use rsync to cp such files and dirs under /var/www/html/mydir directory
but these two files (/dir4/1.html /dir4/2.html) cant rsync to dest mechine.I still dont know why,,give me a hint?thx
rsync configure file,below...
[rsy_file_and_dir]
comment= rsync some files and some dir
path=/var/www/html/mydir
read only= no
Hi All,
Please help.
I have got a file which contains a listing of a file and some directories after it, one by one. I am calling this file xyz.txt here
Code:
file1
dir1
dir2
dir3
dir4
file2
dir5
dir6
dir7
dir8
file3
dir9
dir10
dir11
dir12
Requirement is that I have to pick the files one by one from xyz.txt file i.e. file1 then file2 then file3 ...
hi ,
please help me in this context
pkg1_name="/dir1/dir2/dir3/pkg1.txt"
pkg2_name="/dir1/dir2/dir4/pkg2.txt"
.
.
.
input to the script is pkg1 or pkg2 or ...
i have used pkg variable to save input i.e.
pkg=$1
now i need the following
result=`awk something ${pkg}_name ` for each file
but the output is showing error as
pkg1_name : no such file or d
Single command to ls all the files inside a particular directory hierachy and output this to a file and open this in a vim file so that i can use gf command in vim to browse through all the files inside this hierachy.
eg :
dir1/dir2
and
dir1/dir3
dir2 and dir3 contain the files i need to browse...
Please help...if this is not as optimal solution ,please mention alternate solutions
I am using a for loop to copy files from say DIR1 and DIR2 to DIR3.I have to check whether files are copied from DIR1 and DIR2 and print the respective message.
@path=("$DIR1","$DIR2");
foreach (@path) {
$rc=system("cp $_/*xml $DIR3");
if ($rc == 0)
{
print "Files were copied successfully from $_\n";
}
else
{
print "Files were
I have 2 directories
DIR1 contains file1, file2
DIR2 contains file1, file3
Is there a way to replicate DIR1 to DIR2.
means,
if i give,
cp -r DIR1/* DIR2
file1 in DIR2 gets replaced with file1 in DIR1.
file2 in gets copied to DIR2.
file3 remains untouched.
But, i need DIR2 to be the exact replica of DIR1.