Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old June 2nd, 2004, 02:34 PM
linh linh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 245 linh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 27 sec
Reputation Power: 6
Interpreting Bash command firstchar=${1:0:1}

Interpreting Bash command firstchar=${1:0:1}

1) What does the code on line 8) firstchar=${1:0:1} do ?
2) $ stand for an argument, but what does {1:0:1} do ?

=========================
Code:
1) if [[ $# -eq 2 ]]
2) then
3)   if [[ "$1" != "$2" ]]
4)   then
5)    exit 1 
6)   fi
7) else
8)  firstchar=${1:0:1}
9)  if [[ "$firstchar">"/" && "$firstchar"<":" ]]
10)  then
11)   exit 2   # username cannot start with a number
12)  fi
13) fi

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Interpreting Bash command firstchar=${1:0:1}


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway