The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Not able to understand what's do the statement div_Neev Shell Programming and Scripting 1 02-20-2008 05:46 AM
perl - understand process status and continue the code execution sysgate Shell Programming and Scripting 2 01-04-2008 09:23 AM
can't understand this at all. severndigital UNIX for Dummies Questions & Answers 4 02-21-2007 12:21 PM
can't understand BoyArcher UNIX for Dummies Questions & Answers 5 03-14-2006 09:36 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-02-2008
varungupta varungupta is offline
Registered User
  
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 206
Code Understand ?

Hey,

Could you explain me what this code is doing ?
For example:
Code:
$i has value 9
$1 is the name of the file say FILEBkUp

    while [ "$i" != "1" ]
    do
      if [ -f $1.`/bin/expr $i - 1` ]
      then
        mv -f $1.`/bin/expr $i - 1` $1.$i
      fi
      i=`/bin/expr $i - 1`
    done
Thanks in Advance !
Varun
  #2 (permalink)  
Old 05-02-2008
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Let's say the basename is just xyz...

if xyz.8 exists then move xyz.8 to xyz.9
if xyz.7 exists then move xyz.7 to xyz.8
.
.
.
if xyz.1 exists then move xyz.1 to xyz.2
  #3 (permalink)  
Old 05-02-2008
varungupta varungupta is offline
Registered User
  
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 206
Quote:
Originally Posted by Perderabo View Post
Let's say the basename is just xyz...

if xyz.8 exists then move xyz.8 to xyz.9
if xyz.7 exists then move xyz.7 to xyz.8
.
.
.
if xyz.1 exists then move xyz.1 to xyz.2
Hey,

I got it.
Thanks a lot !
VarunGupta
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0