given a relative path, how do i convert it into a full one. i.e. if i am in
/home/polypus
and i am given foo/bar then to get a full path i can just concatinate it with pwd, but what if i am given "../mama"
how do i programmatically convert:
/home/polypus and ../mama into ... (4 Replies)
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... (1 Reply)
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)
First i need to find all scripts directly under /DIR that end with ".sh" extension except "noallow.sh". That can be done with:
find /DIR -maxdepth 1 -name "*.sh"|grep -v "noallow.sh"
Now i want to run all the files output from the previous command.
The following code:
for filename in... (6 Replies)
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)
Hi,
I have a file abcd.txt which has contents in the form of full path file names i.e.
$home> vi abcd.txt
/a/b/c/r1.txt
/q/w/e/r2.txt
/z/x/c/r3.txt
Now I want to retrieve only the directory path name for each row
i.e
/a/b/c/
/q/w/e/
How to get the same through shell script?... (7 Replies)
I have dir structure like this :
/opt/oracle/product/abc/sqlplus/admin/
/opt/oracle/product/def/sqlplus/admin
/opt/oracle/product/ghi/sqlplus/admin
I am trying to use wildcard ( for dirs abc,def,ghi) ..something like this :
cp xyz.txt ... (1 Reply)
Hi,
In Linux, I had modified fstab file which used to mount ~/Music, ~/Pictures, etc with disk partitions containing corresponding content or binding directory located at other partition. But I am wondering can I do same in El-Capitan as well? No linking!
/media/L-Store/Desktop/Documents ... (0 Replies)
Discussion started by: ezee
0 Replies
LEARN ABOUT MOJAVE
pwd
PWD(1) BSD General Commands Manual PWD(1)NAME
pwd -- return working directory name
SYNOPSIS
pwd [-L | -P]
DESCRIPTION
The pwd utility writes the absolute pathname of the current working directory to the standard output.
Some shells may provide a builtin pwd command which is similar or identical to this utility. Consult the builtin(1) manual page.
The options are as follows:
-L Display the logical current working directory.
-P Display the physical current working directory (all symbolic links resolved).
If no options are specified, the -L option is assumed.
ENVIRONMENT
Environment variables used by pwd:
PWD Logical current working directory.
EXIT STATUS
The pwd utility exits 0 on success, and >0 if an error occurs.
SEE ALSO builtin(1), cd(1), csh(1), sh(1), getcwd(3)STANDARDS
The pwd utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
BUGS
In csh(1) the command dirs is always faster because it is built into that shell. However, it can give a different answer in the rare case
that the current directory or a containing directory was moved after the shell descended into it.
The -L option does not work unless the PWD environment variable is exported by the shell.
BSD April 12, 2003 BSD