Home » Infrastructure » Unix » Need some adice on shell scripting
Need some adice on shell scripting [message #255677] Wed, 01 August 2007 08:31 Go to next message
puneetsachar
Messages: 97
Registered: March 2005
Location: New Delhi, India
Member

hi guys!!!

I have small problem..

I need to seprate the path and the file name

E.g

/u01/app/oracle/LONDON/admin/logs/abc.txt
/u01/app/admin/log/abc.txt
/usr/app/oracle/app/admin/logs/CRP/abc.txt

I want to seprate the abc.tx and the path and store them in variables.

If my path was not dyamic i thought of using and implementing following logic

PUNEET=/u01/app/oracle/LONDON/admin/logs/abc.txt
export PUNEET
echo $PUNEET|cut -f7 -d/ which will give me abc.txt

however now my patch is dynamic,so i can't implement it

Please advice,,,,

Puneet
Re: Need some adice on shell scripting [message #255689 is a reply to message #255677] Wed, 01 August 2007 08:55 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
What is your OS and shell?

Regards
Michel
Re: Need some adice on shell scripting [message #255695 is a reply to message #255677] Wed, 01 August 2007 09:07 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
$ man basename
$ man dirname

[Updated on: Wed, 01 August 2007 09:07] by Moderator

Report message to a moderator

Re: Need some adice on shell scripting [message #255780 is a reply to message #255695] Wed, 01 August 2007 14:23 Go to previous messageGo to next message
puneetsachar
Messages: 97
Registered: March 2005
Location: New Delhi, India
Member

Hi

I'm very much new to this shell scripting...

Please can u help in understanding with example.

Puneet
Re: Need some adice on shell scripting [message #255781 is a reply to message #255689] Wed, 01 August 2007 14:24 Go to previous messageGo to next message
puneetsachar
Messages: 97
Registered: March 2005
Location: New Delhi, India
Member

Hi

its Linix and shell I guess is ksh.

Please help me in understanding with example..

Thanks a ton

Puneet
Re: Need some adice on shell scripting [message #255786 is a reply to message #255677] Wed, 01 August 2007 14:33 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
1) This has NOTHING to do with Oracle.
2) If you can't read & learn from man pages, maybe you should stick to GUI where you don't have to think too hard.
Re: Need some adice on shell scripting [message #255787 is a reply to message #255781] Wed, 01 August 2007 14:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
There are examples in man pages.

Regards
Michel
Re: Need some adice on shell scripting [message #255798 is a reply to message #255787] Wed, 01 August 2007 15:14 Go to previous message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Lot of unix/linux and shell scripting books.

UNIX
http://www.scribd.com/search?query=Unix+

LINUX
http://www.scribd.com/search?query=LINUX&commit=search

[Updated on: Wed, 01 August 2007 15:21]

Report message to a moderator

Previous Topic: Oracle Link Warnings on P570
Next Topic: know processor details
Goto Forum:
  


Current Time: Fri Nov 22 04:23:32 CST 2024