05-12-2014
You might want to check out stat filename
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
So I dont enounter things like:
gzip: /sometimename.gz already exists; do you wish to overwrite (y or n)?
Want to add it into a script and if there is a file aready there to just overwrite it, otherwise the script will hang unless there is manual intervention. (1 Reply)
Discussion started by: LordJezo
1 Replies
2. Shell Programming and Scripting
Hi all,
In our webserver customer wants to see the latest 10 files arrived. So the names are hardcoded in webpage like :
filename_01.txt
filename_02.txt
....
....
filename_10.txt
where the filename_01.txt is the latest one (typically the output of ls -1t) in the /../webpage directory.... (2 Replies)
Discussion started by: sabyasm
2 Replies
3. Shell Programming and Scripting
How to overwrite every time a particular portion of a file?
---------- Post updated at 02:16 PM ---------- Previous update was at 02:07 PM ----------
I have a file whose contents are something like:
Output of "apachectl fullstatus" command:
---------------------------------------------... (3 Replies)
Discussion started by: proactiveaditya
3 Replies
4. Programming
Hi ,
i have two basic requirement on linux platform . I am using C language to do this .
1) copying one file to another (assuming i know their file descriptors)
2) Overwriting a file using it file descriptor .
Please guide.
regards
Aki (2 Replies)
Discussion started by: meet123321
2 Replies
5. Linux
Long story short, there was some sort of corruption with my ide and the script I was working on has been over written with nothing (the file is blank now). The IDE doesn't store a back up from what I know (I'm using notepadd++ in wine lol I know I know I'm addictted to the nppftp sidebar and geany... (1 Reply)
Discussion started by: noPermissions
1 Replies
6. UNIX Desktop Questions & Answers
I have loads of files in different directories which I do miner changed on them and till now I have to create totally new directories for them, specially as I deal with a whole directory at once :wall::wall::wall::wall:
it creates such as mess really
e.g.
FILES="F1/*"
for X in $FILES
do... (2 Replies)
Discussion started by: A-V
2 Replies
7. Shell Programming and Scripting
I have a script, which runs through cronjob every night 9 PM. It is supposed to do following tasks --
1- Connect to ftp.testsite.com via user redtest
2- Fetch file red_bill.txt to my local server, where my script is residing.
3- Rename red_bill.txt to red_bill.V01.txt everyday on sftp server.... (4 Replies)
Discussion started by: solaris_1977
4 Replies
8. Shell Programming and Scripting
hi
i have a file as in follwoing:
cat apple.txt
Apple is a fruit
But this fruit is costly
Now I used the sed command and i see output as in following
# sed 's/fruit/healthy &/' fruit.txt
Apple is a healthy fruit
But this healthy fruit is costly
#
sed works fine here. But... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
9. Shell Programming and Scripting
Hello,
I have been working on script in which search and replace the multiple pattern.
1. update_params.sh read the multiple pattern from input file ParamMapping.txt(old_entry|New_entry) and passing this values one by one to change_text.sh
2. change_text.sh read... (0 Replies)
Discussion started by: ketanraut
0 Replies
10. UNIX and Linux Applications
Hi Everyone,
We are trying to do a logrotate for "catalina.out" daily, So have used the "copytruncate" option in the logrotate configuration but ended up seeing there was a 0kb file touched with "catalina.out" and the other file with the current date(compressed) file created and seems the log is... (2 Replies)
Discussion started by: thiyagoo
2 Replies
MEGATRON(1) General Commands Manual MEGATRON(1)
NAME
megatron, unhex, unbin, unsingle, hqx2bin, single2bin, macbinary - Macintosh file format transformer
SYNOPSIS
megatron [ sourcefile... ]
unbin [ sourcefile... ]
unhex [ sourcefile... ]
unsingle [ sourcefile... ]
hqx2bin [ sourcefile... ]
single2bin [ sourcefile... ]
macbinary [ sourcefile... ]
DESCRIPTION
megatron is used to transform files from BinHex, MacBinary, AppleSingle, or netatalk style AppleDouble formats into MacBinary or netatalk
style AppleDouble formats. The netatalk style AppleDouble format is the file format used by afpd, the netatalk Apple Filing Protocol
(AppleShare) server. BinHex, MacBinary, and AppleSingle are commonly used formats for transferring Macintosh files between machines via
email or file transfer protocols. megatron uses its name to determine what type of tranformation is being asked of it.
If megatron is called as unhex, unbin, or unsingle, it tries to convert file(s) from BinHex, MacBinary, or AppleSingle into AppleDouble
format. BinHex is the format most often used to send Macintosh files by e-mail. Usually these files have an extension of ".hqx". MacBi-
nary is the format most often used by terminal emulators "on the fly" when transferring Macintosh files in binary mode. MacBinary files
often have an extension of ".bin". Some Macintosh LAN-based email packages use uuencoded AppleSingle format to "attach" or "enclose" files
in email. AppleSingle files don't have a standard filename extension.
If megatron is called as hqx2bin, single2bin, or macbinary, it will try to convert the file(s) from BinHex, AppleSingle, or AppleDouble
into MacBinary. This last translation may be useful in moving Macintosh files from your afpd server to some other machine when you can't
copy them from the server using a Macintosh for some reason.
If megatron is called with any other name, it uses the default translation, namely unhex.
If no source file is given, or if sourcefile is `-', and if the conversion is from a BinHex or MacBinary file, megatron will read from
standard input.
The filename used to store any output file is the filename that is encoded in the source file. MacBinary files are created with a ".bin"
extension. In the case of conflicts, the old file is overwritten!
SEE ALSO
afpd(8)
netatalk 1.2 8 Jan 1992 MEGATRON(1)