Sponsored Content
Full Discussion: explanation for this line
Top Forums Shell Programming and Scripting explanation for this line Post 302163204 by Perderabo on Thursday 31st of January 2008 08:51:49 AM
Old 01-31-2008
It is an attempt to set the variable Parent. You need to follow it with
echo $Parent
to see anything. Basicly, it strips off a trailing slash followed by some characters. Should the regular expression not match, it just returns the input variable. It will stumble if BackupLocation is set to something like "/abc" which matches the regular expression without returning anything. But that input may not be likely. My preferred solution
Parent=${BackupLocation%/*}
would have the same trouble. A better solution might be:
Parent=$(dirname $BackupLocation)
which should work all the time.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

explanation of this line

Hi Gurus, sqlplus system @$1 0</opt/oracle/pwdfile What would be the output of the above life....the password for the user "system" the user is stored in /opt/oracle/pwdfile When i try to run the script it says password not found? $1 0< What is the meaning of the $1 and 0? ... (1 Reply)
Discussion started by: castlerock
1 Replies

2. Shell Programming and Scripting

tr explanation please

how does below tr command replace nonletters with newlines? I think I understand tr -cs '\n' part.. but what is A-Za-z\' <--- what is this?? tr -cs A-Za-z\' '\n' | -c --complement -s, --squeeze-repeats replace each input sequence of a repeated character that is... (0 Replies)
Discussion started by: convenientstore
0 Replies

3. Shell Programming and Scripting

tr explanation please

how does below tr command replace nonletters with newlines? I think I understand tr -cs '\n' part.. but what is A-Za-z\' <--- what is this?? tr -cs A-Za-z\' '\n' | -c --complement -s, --squeeze-repeats replace each input sequence of a repeated character that is... (1 Reply)
Discussion started by: convenientstore
1 Replies

4. UNIX and Linux Applications

need explanation

Hi am having a c pgm. It has the include files (unistd.h,sys/types.h,win.h,scr.h,curses.h,stdarg.h and color.h). I don't know the purpose of these include files. will u plz explain me. (1 Reply)
Discussion started by: Mari.kb
1 Replies

5. Shell Programming and Scripting

command line explanation

Hello everyone, I found this command line in a website: perl -pi.bak -we's/\z/Your new line\n/ if $. == 2;' your_text_file.txt With this command line you can insert a new line anywhere you want in a text without overwriting what's in it. -p causes perl to assume a loop around your... (4 Replies)
Discussion started by: goude
4 Replies

6. Shell Programming and Scripting

same action in then as in else: explanation?

in /etc/init.d/networking of an ubuntu computer, I found this code: if ifdown -a --exclude=lo; then log_action_end_msg $? else log_action_end_msg $? fi Shouldn't it be replace by ifdown -a --exclude=lo ... (0 Replies)
Discussion started by: raphinou
0 Replies

7. UNIX for Dummies Questions & Answers

In need of explanation

Its great someone provided this script that strips out a filename and extension but can someone explain how each line works? file1='Jane Mid Doe.txt' newfile='Jane.txt' 1) ext=${file1##*.} 2) filename=${file%%.???} 3) set -- $filename 4) newfile="1.$extension" (1 Reply)
Discussion started by: Lillyt
1 Replies

8. Shell Programming and Scripting

code explanation

Can you please explain the following code plz? my_cd=' ' while getopts :e: OPTION; do case "$OPTION" in e) my_cd ="$OPTARG";; esac done if ; then echo " >>> ERROR - I am wrong" echo " >>> ERROR - Hello" exit 99 fi What I don't understand is what is OPTION or... (3 Replies)
Discussion started by: RubinPat
3 Replies

9. UNIX for Dummies Questions & Answers

Code explanation?

I need someone to tell me how exactly works the following code αfter /etc/passwd :eek:: cat /etc/passwd|grep "^:"|sed '1,$s/^\(*\):*:\(*\):.*$/ \1 \2 /'|sort -nrk3 -t:I want a good explanation to understand the code please (4 Replies)
Discussion started by: kotsos13
4 Replies

10. Shell Programming and Scripting

Need explanation

Hi, I need more explination on it, how it works abcd="$(echo "$abcd" | sed 's/ //g')" >> ${LOGFILE} 2>&1 can any one suggest me on this? Rgds, LKR (1 Reply)
Discussion started by: lakshmanraok
1 Replies
wxPrinter(3erl) 					     Erlang Module Definition						   wxPrinter(3erl)

NAME
wxPrinter - See external documentation: wxPrinter. DESCRIPTION
See external documentation: wxPrinter . DATA TYPES
wxPrinter() : An object reference, The representation is internal and can be changed without notice. It can't be used for comparsion stored on disc or distributed for use on other nodes. EXPORTS
new() -> wxPrinter() Equivalent to new([]) . new(Options::[Option]) -> wxPrinter() Types Option = {data, wxPrintDialogData() (see module wxPrintDialogData)} See external documentation . createAbortWindow(This::wxPrinter(), Parent::wxWindow() (see module wxWindow), Printout::wxPrintout() (see module wxPrintout)) -> wxWin- dow() (see module wxWindow) See external documentation . getAbort(This::wxPrinter()) -> bool() See external documentation . getLastError() -> WxPrinterError Types WxPrinterError = integer() See external documentation . WxPrinterError is one of ?wxPRINTER_NO_ERROR | ?wxPRINTER_CANCELLED | ?wxPRINTER_ERROR getPrintDialogData(This::wxPrinter()) -> wxPrintDialogData() (see module wxPrintDialogData) See external documentation . print(This::wxPrinter(), Parent::wxWindow() (see module wxWindow), Printout::wxPrintout() (see module wxPrintout)) -> bool() Equivalent to print(This, Parent, Printout, []) . print(This::wxPrinter(), Parent::wxWindow() (see module wxWindow), Printout::wxPrintout() (see module wxPrintout), Options::[Option]) -> bool() Types Option = {prompt, bool()} See external documentation . printDialog(This::wxPrinter(), Parent::wxWindow() (see module wxWindow)) -> wxDC() (see module wxDC) See external documentation . reportError(This::wxPrinter(), Parent::wxWindow() (see module wxWindow), Printout::wxPrintout() (see module wxPrintout), Message::string()) -> ok See external documentation . setup(This::wxPrinter(), Parent::wxWindow() (see module wxWindow)) -> bool() See external documentation . destroy(This::wxPrinter()) -> ok Destroys this object, do not use object again AUTHORS
<> wxErlang 0.98.9 wxPrinter(3erl)
All times are GMT -4. The time now is 03:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy