LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-06-2007, 05:56 AM   #1
davee
Member
 
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Rep: Reputation: 30
ksh variable?


Hi all,

I've go the following two lines at the top of a ksh script:

logfile=`ls -t /www/Apache/logs/error_log.* | head -1`
oldlog=/root/unix_admin/${logfile##*/}

I've never come across the ##*/ before, and it's not the easiest thing to Google... Is it regex notation? If not, what is it? I'm not a ksh expert, but I know what I'm doing in bash...

Cheers in advance,

Davee
 
Old 07-06-2007, 06:24 AM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Here is where you want to start reading: http://www.kornshell.com/doc/
Basically it's ksh's way of extracting some substring I think (ie ksh specific regex notation)
 
  


Reply

Tags
ksh, scripting, variables


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace variable with user defined variable ce124 Programming 10 04-13-2007 09:29 AM
setting a variable variable in a script... this works, but could it be more elegant? pwc101 Programming 3 08-18-2006 11:23 AM
Scripting: accessing a variable stored in a variable? tomolesonjr Linux - Newbie 5 05-05-2006 08:47 PM
ksh - get stdout name as variable mhcueball2 Programming 11 07-16-2005 10:50 AM
[KSH-Regular Expressions] How can I specify Repition patterns in a variable? Aziz Programming 0 11-02-2004 01:01 PM


All times are GMT -5. The time now is 11:58 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration