ls -t produces a list of filenames, sorted by modification time, newest first. head -1 picks the first filename (the newest).
This value is assign to the variable file.
The -s option in the test expression checks, if the file exists and is not of size zero.
If the test is true, something is executed.
---------- Post updated at 15:59 ---------- Previous update was at 15:57 ----------
Quote:
Originally Posted by teresaejunior
Sorry to correct you, but -z tests, if the variable $file is empty and not if the file named by this variable is empty or not. Use -s for this.
:mad: I did this the other day but one of my support personnel removed my history so i could call it back up to remeber the exact command since i am air-headed at times. I am trying to take a 30 MEG file off the system and drop it to tape then i want to make the file go back to being 0 bytes so... (1 Reply)
Hi all,
Does anybody know or guide me on how to remove the first N bytes and the last N bytes from a binary file? Is there any AWK or SED or any command that I can use to achieve this?
Your help is greatly appreciated!!
Best Regards,
Naveen. (1 Reply)
What is the easiest way to inspect the bytes stored in a file?
Ideally, If my file was 10 bytes each of which had only the high bit set, I'd be able to browse for it and get output like this:
01 - 10000000
02 - 10000000
03 - 10000000
04 - 10000000
05 - 10000000
06 - 10000000
07 -... (7 Replies)
While running script I am getting an error like
Few lines in data are not being processed.
After googling it I came to know that adding such line would give some memory to it
ini_set("memory_limit","64M");
my input file size is 1 GB.
Is that memory limit is based on RAM we have on... (1 Reply)
Hi,
If I want to copy a 1024 byte data stream in to the target location in 3-bytes chunk, I guess I can use the following script.
dd bs=1024 count=3 if=/src of=/dest
But, I would like to know, how to do it via a C program. I have tried this with memcpy(), that did not help. (3 Replies)
Hello guys. I really hope someone will help me with this one..
So, I have to write this script who:
- creates a file home/student/vmdisk of 10 mb
- formats that file to ext3
- mounts that partition to /mnt/partition
- creates a file /mnt/partition/data. In this file, there will... (1 Reply)
hello,
suppose, entered input is of 1-40 bytes, i need it to be converted to 40 bytes exactly.
example: if i have entered my name anywhere between 1-40 i want it to be stored with 40 bytes exactly.
enter your name:
donald duck (this is of 11 bytes)
expected is as below - display 11... (3 Replies)
is there a better way to do this:
head -c 10000k /var/dump.log | head -c 6000k
unfortunately, the "-c" option is not available on sun solaris. so i'm looking at "dd". but i dont know how to use it to achieve the same exact goal as the above head command.
this needs to work on both solaris... (5 Replies)
Hi Expert,
I'm having grub problem here:
grub> root
(hd0,0): Filesystem type is ext2
grub> setup
Error 11 : Unrecognized Device String
I try install boot loader follow the instruction from 26.2. Booting into Rescue Mode
It says : select Continue, it attempts to mount your file... (4 Replies)
Discussion started by: justbow
4 Replies
LEARN ABOUT MOJAVE
acyclic
ACYCLIC(1) General Commands Manual ACYCLIC(1)NAME
acyclic - make directed graph acyclic
SYNOPSIS
acyclic [ -nv? ] [ -o outfile ] [ file ]
DESCRIPTION
acyclic is a filter that takes a directed graph as input and outputs a copy of the graph with sufficient edges reversed to make the graph
acyclic. The reversed edge inherits all of the attributes of the original edge. The optional file argument specifies where the the input
graph is stored; by default, the program reads from stdin.
OPTIONS
The following options are supported:
-n No output is produced, though the return value will indicate whether the graph is acyclic or not.
-v Print information about whether the file is acyclic, has a cycle or is undirected.
-o outfile
causes the output to be written to the specified file; by default, output is written to stdout.
-? option causes the program to print usage information.
RETURN CODES
acyclic returns 0 if the graph is acyclic; 1 if the graph has a cycle; 2 if the graph is undirected; and 255 if there are any errors.
BUGS
If the graph is strict and there is a cycle of length 2, the attributes of the reversed edge are lost.
Some edge attributes are non-symmetric, referring to either the head or tail node. At present, there is no mechanism or convention for cor-
rectly switching or renaming these.
AUTHORS
Stephen C. North <north@research.att.com>
Emden R. Gansner <erg@research.att.com>
SEE ALSO gc(1), dot(1), gvpr(1), gvcolor(1), ccomps(1), sccmap(1), tred(1), libgraph(3)
21 March 2001 ACYCLIC(1)