Representing dir path for copy through env variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Representing dir path for copy through env variable
# 1  
Old 05-12-2009
Representing dir path for copy through env variable

Hello ,
i am on linux,
and im trying to figure out why my cp command cant copy one file.
I am trying to use variable in which i stored path to location where is file i wish to copy.

Code:
[oracle@g5 ~]$ echo $ORA_ALERT_LOG
/u01/app/oracle/diag/rdbms/ring11/ring11/trace
[oracle@g5 ~]$
[oracle@g5 ~]$
[oracle@g5 ~]$ pwd
/home/oracle
[oracle@g5 ~]$ cp -p $ORA_ALERT_LOG/alert_ring11.log $ORA_ALERT_LOG/alert.ring11.log$DATE
[oracle@g5 ~]$
[oracle@g5 ~]$ echo $DATE
05_12_09
[oracle@g5 ~]$ ls -l /u01/app/oracle/diag/rdbms/ring11/ring11/trace/alert_ring11*
-rw-r----- 1 oracle oinstall 25859055 2009-05-12 10:52 /u01/app/oracle/diag/rdbms/ring11/ring11/trace/alert_ring11.log

I dont know why cp command don't use path got from $ORA_ALERT_LOG variable...
Should i use it in some other way ?
# 2  
Old 05-12-2009
Your copied file name is alert.ring11* not alert_ring11* .
# 3  
Old 05-12-2009
Quote:
Originally Posted by methyl
Your copied file name is alert.ring11* not alert_ring11* .

whell ,
except thanks,
Smilie Smilie Smilie Smilie Smilie Smilie Smilie Smilie


thanks Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Can't pass a variable representing the output of lsb_release to a docker dontainer

I don't know why, but the rendering of my code mucks up the spacing and indentation, despite being correct in the original file. I'm having issues getting the following script to run (specifically the nested script at the end of the docker command near the end of the script; I think I'm not passing... (2 Replies)
Discussion started by: James Ray
2 Replies

2. UNIX for Dummies Questions & Answers

Env file path

Hi, when I run "env" there are few variable prinitng related to application $env SRV=test NVV=test2 from where this file is invoking, I checked in ./bash_profile and ./profile didn't find the variable. So what is the file I need to edit this variable. (8 Replies)
Discussion started by: stew
8 Replies

3. Web Development

Deny from env=env-variable Does not work

(Above from Apache docs). On my system, using: SetEnvIf User-Agent Mozilla IsBad=1 Order allow,deny Allow from all Deny from env=IsBad ...I see that environment variable is set (using phpinfo()) but the page is still served. No errors in the Apache logs. (1 Reply)
Discussion started by: gnurob
1 Replies

4. UNIX for Dummies Questions & Answers

Unzip & Env Path Name

I need to download team foundation server on Unix (4 simple instructions below), but I am stuck.. I am newbie Unix user, so please be patient. -cd /home/Myname/Downloads, Unzip -Unzipped to /home/Myname/DestFolder -cd DestFolder, type tf -help, works there - outside this folder, doesn't... (1 Reply)
Discussion started by: software2007
1 Replies

5. Shell Programming and Scripting

Copy files and subdirs from dir to a new dir

Hello Comunity I am trying to make a bash shell script that it copies files and subdirs(with files) to a new dir. I would like the dest_dir to contain only subdirectories with files not other subdirs inside. it called : cpflatdir src_dir dest_dir Pleaze help me! Thank you in... (2 Replies)
Discussion started by: BTKBaaMMM
2 Replies

6. UNIX and Linux Applications

CPIO Problem, copy to the root dir / instead of current dir

HI all, I got a CPIO archive that contains a unix filesystem that I try to extract, but it extract to the root dir / unstead of current dir, and happily it detects my file are newer otherwise it would have overwrited my system's file! I tried all these commands cpio -i --make-directories <... (2 Replies)
Discussion started by: nekkro-kvlt
2 Replies

7. Shell Programming and Scripting

How do I define a particular dir in PATH variable and then unset that dir

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

8. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: yahoo!
1 Replies

9. UNIX for Dummies Questions & Answers

Questions on PATH env havinf softlink

I have a question regarding the PATH environment on SunOS. I am setting the PATH as - export PATH=$PATH:/bin and /bin has a softlink as lrwxrwxrwx 1 root root 9 Oct 1 2004 /bin -> ./usr/bin So, will this path will work for the bin having the softlink? Thanks for... (1 Reply)
Discussion started by: xgr3
1 Replies

10. UNIX for Dummies Questions & Answers

Need to know path of dir currently in.

Which command will help us to get the directory path? (4 Replies)
Discussion started by: videsh77
4 Replies
Login or Register to Ask a Question