07-24-2008
full path of a file situated either in parent's dir. or parent's parent dir. so on...
hi experts(novice people can stay away as it is no child's game),
i am developing a script which works like recycle bin of windows.
the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to capture the path of the file.
eg:--
i am presently working in /fs/home/u1/proj
and i am trying to delete files of parent directory or parent's parent directory as shown below......
/fs/home/u1/proj> rm ..file1
dont get confused as "rm" has been aliased with "mv" command which will move the "file1" to a directory called "recyclebin".....
My intention is to move the file1 along with its complete path so that i can retreive it back to the original directory from where it got deleted as happens in Windows(Recycle bin)........
hope there is some command such as "dirname" or something of that sort....
Thanks in advance....................
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How do I define a particular dir in front of PATH variable and then run some job and then at the end of job SET the PATH variable to original?
in a script, WILL something like this work:
ORIG_PATH=$PATH
export PATH=/dir1/dir2:$PATH
RUN SOME JOBS .....
unset PATH
EXPORT... (2 Replies)
Discussion started by: Hangman2
2 Replies
2. Shell Programming and Scripting
Started a thread in beginners but I thought someone from this forum may have an idea as well. Thanks!
EDITED BY REBORG (3 Replies)
Discussion started by: robotsbite
3 Replies
3. Shell Programming and Scripting
In shell how would I get the parent directory of a file. E.g. I feed this in:
/path/to/textfile.txt
And get just:
/path/to
Thanks (2 Replies)
Discussion started by: pcwiz
2 Replies
4. Windows & DOS: Issues & Discussions
Hi,
(Apologies, I'm sure I'm not the first person to raise this question but so far in my searches haven't found a good answer).
I would like to output a listing per line of filename (including full path) and 'last updated' timestamp. e.g:
Z:\dir1\file1.txt 01/02/2010 10:43... (5 Replies)
Discussion started by: GM_AIX
5 Replies
5. Shell Programming and Scripting
Hi everyone
i am very new to linux , working on bash shell.
I am trying to solve the given problem
1. Create a process and then create children using fork
2. Check the Status of the application for successful running.
3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies
6. Shell Programming and Scripting
How to list all Subdirectories and files with its full path in a parent directory? (1 Reply)
Discussion started by: johnveslin
1 Replies
7. Shell Programming and Scripting
lyang0@lyang0-OptiPlex-755:~$ ./test.sh
.
lyang0@lyang0-OptiPlex-755:~$ cat test.sh
#!/bin/bash
echo `dirname $0`
lyang0@lyang0-OptiPlex-755:~$ pwd
/home/lyang0
it doesn't get "/home/lyang0" and only when run /home/lyang0/test.sh it will get, but how can I do, then it can get the real... (8 Replies)
Discussion started by: yanglei_fage
8 Replies
8. Shell Programming and Scripting
Hi All,
Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created.
/Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt
/Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies
9. UNIX for Beginners Questions & Answers
Hi All,
Just started learning unix and stuck into below issue.
Suppose i have folder structure as below.
Dir1/Dir2/Dir3/File1.msg
I am looking to rename the file name from File1.msg to File2.msg but from the parent Dir1
From Dir3 i can easily run the command like
mv File1.msg... (2 Replies)
Discussion started by: Gurjeet Singh
2 Replies
10. UNIX for Beginners Questions & Answers
Hi and good day,
This string lets me find the html files:
ls -R /Volumes/LC3/Sites/chu | grep "html"
But how to list the files with their parent dir 'attached' to them:
For example:
n/fofo.html
n/siso.html
m/…
/
Any assistance would be greatly appreciated!
With best regards,... (5 Replies)
Discussion started by: OmarKN
5 Replies
LEARN ABOUT OSF1
xreparentwindow
XReparentWindow(3X11) XReparentWindow(3X11)
NAME
XReparentWindow - reparent windows
SYNOPSIS
XReparentWindow(display, w, parent, x, y)
Display *display;
Window w;
Window parent;
int x, y;
ARGUMENTS
Specifies the connection to the X server. Specifies the parent window. Specifies the window. Specify the x and y coordinates of the
position in the new parent window.
DESCRIPTION
If the specified window is mapped, XReparentWindow automatically performs an UnmapWindow request on it, removes it from its current posi-
tion in the hierarchy, and inserts it as the child of the specified parent. The window is placed in the stacking order on top with respect
to sibling windows.
After reparenting the specified window, XReparentWindow causes the X server to generate a ReparentNotify event. The override_redirect mem-
ber returned in this event is set to the window's corresponding attribute. Window manager clients usually should ignore this window if this
member is set to True. Finally, if the specified window was originally mapped, the X server automatically performs a MapWindow request on
it.
The X server performs normal exposure processing on formerly obscured windows. The X server might not generate Expose events for regions
from the initial UnmapWindow request that are immediately obscured by the final MapWindow request. A BadMatch error results if: The new
parent window is not on the same screen as the old parent window. The new parent window is the specified window or an inferior of the
specified window. The new parent is InputOnly, and the window is not. The specified window has a ParentRelative background, and the new
parent window is not the same depth as the specified window.
XReparentWindow can generate BadMatch and BadWindow errors.
DIAGNOSTICS
A value for a Window argument does not name a defined Window.
SEE ALSO
XChangeSaveSet(3X11)
Xlib -- C Language X Interface
XReparentWindow(3X11)