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 Sat 25 Oct 2014, 20:23
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 Posts_count_1  
Author Message
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sat 17 Apr 2010, 13:50    Post_subject:  Trick for Tests
Sub_title: 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:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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