[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

bash: how to check if first character of string is "/"?



  it's late so i'm sure i'm just being dense in not knowing this, but
is there a simpler way to check if the first character of a string is
a "/" rather than the cumbersome:

  if [ "x${VAR##/*}" = "x" ] ; then ...

surely there must be *something* that doesn't look quite so grotesque.

rday

-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]