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 Fri 19 Dec 2014, 22:34
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How can I creat a logfile? SOLVED
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 822
Location: Mishawaka IN

PostPosted: Sat 22 Mar 2014, 11:44    Post subject:  How can I creat a logfile? SOLVED  

Hello Everyone,

I would like to know how I can make a file with a name of a pet as the name of the file with the file not having any thing written on it. What I want is to have a file in the dir where the pet gets downloaded so the it can't get downloaded again once it has been moved.

I am sure there is probably a better way of doing this.

Code:

#!/bin/sh


mkdir /root/Downloads/sfs

cd /root/Downloads/sfs

if [ -f /root/Downloads/sfs/devx_fluxpup_1.5.sfs ]; then
Xdialog --msgbox "All ready downloaded" 0 0
else
rxvt -geometry 130x10+0+0 -bg black -fg green -e wget -4 -t 2 -T 20 http://smokey01.com/Oldyeller/FluxPup/devx_fluxpup_1.5.sfs
Xdialog -title="Move"  --yesno "Do you have a savefile" 0 0
if [ $? -eq 0 ]; then
Xdialog -title="Move"  --yesno "Do you want to move file to mnt/home" 0 0
if [ $? -eq 0 ]; then
mv /root/Downloads/sfs/devx_fluxpup_1.5.sfs /mnt/home then
Xdialog --msgbox "Finished" 0 0
fi
fi
fi
exit 0

Last edited by oldyeller on Sat 22 Mar 2014, 15:34; edited 1 time in total
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2291

PostPosted: Sat 22 Mar 2014, 11:59    Post subject:  

Usually you'd see 'touch' used for this:
touch name-of-file
But, you can also simply do:
: > name-of-file
or:
> name-of-file
cat /dev/null > name-of-file
echo "" > name-of-file

All the above create an empty file.
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 822
Location: Mishawaka IN

PostPosted: Sat 22 Mar 2014, 15:34    Post subject:  

Thanks amigo,

That worked just fine.

Cheers
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
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.0417s ][ Queries: 11 (0.0057s) ][ GZIP on ]