Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 22 Jul 2014, 21:48
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Trick for Tests
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sat 17 Apr 2010, 13:50    Post subject:  Trick for Tests
Subject description: search vs edit
 

Kind of counter-intuitive, but for searching vs editing a password file using [ -e $1 ], this works:

Code:

#!/bin/ash

if [ ! -e $1 ]; then 
  grep -i  $1  /pass.txt
else
  vim /pass.txt
fi
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0331s ][ Queries: 11 (0.0034s) ][ GZIP on ]