How can I creat a logfile? SOLVED

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

How can I creat a logfile? SOLVED

#1 Post by oldyeller »

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: Select all

#!/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, 19:34, edited 1 time in total.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#2 Post by amigo »

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.

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#3 Post by oldyeller »

Thanks amigo,

That worked just fine.

Cheers

Post Reply