![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple for script question | Vryali | Shell Programming and Scripting | 1 | 06-27-2008 08:09 AM |
| Simple Shell Script Question.... [java related] | Drags111 | Shell Programming and Scripting | 3 | 12-22-2007 05:23 AM |
| Simple script loop question | mattlock73 | Shell Programming and Scripting | 2 | 05-17-2006 12:55 AM |
| Ok simple question for simple knowledge... | Corrail | UNIX for Dummies Questions & Answers | 1 | 11-28-2005 01:03 PM |
| Simple awk script question | Bab00shka | Shell Programming and Scripting | 2 | 12-06-2004 11:07 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
simple sh script question
folowing code is not working I am a newbie can u help me about it I need to match an array variable to a pattern which is like -rw-r--r--
if [ ${fileinfo[4]} =.r........ ] /* I tried to make every like to accept every thing that starts with any char that has secon char as r and accept any 8 chars after *\ then . . . fi if u can show me how to match a pattern I would be glad |
|
||||
|
one way
Code:
echo "$somevar" | grep -q '-rw-r--r--'
if [[ $? -eq 0 ]] ; then
echo "found"
else
echo "not found"
fi
However if you are looking for files in a directory with specific permissions, consider using Code:
find dir_to_search -perm [perms you want] -print |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|