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, 15:59
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 Posts_count  
Author Message
oldyeller


Joined: 15 Nov 2011
Posts: 812
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

Edited_time_total
Back to top
View user's profile Send_private_message 
amigo

Joined: 02 Apr 2007
Posts: 2261

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: 812
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:   Sort by:   
Page 1 of 1 Posts_count  
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.0413s ][ Queries: 11 (0.0035s) ][ GZIP on ]