logname – print user´s login name

A UNIX Command

$logname
jeffrin
$logname --help
Usage: logname [OPTION]
Print the name of the current user.

      --help     display this help and exit
      --version  output version information and exit

Report logname bugs to bug-coreutils@gnu.org
GNU coreutils home page: 
General help using GNU software: 
For complete documentation, run: info coreutils 'logname invocation'
$logname --version
logname (GNU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by FIXME: unknown.
$

UNIX Explanation

Solaris Based Explanation
The logname  utility will write the user's  login name to
standard output.  The login name is the string that would
be  returned  by the  getlogin(3C)  function.  Under  the
conditions  where  getlogin()  would fail,  logname  will
write  a diagnostic  message to  standard error  and exit
with a non-zero exit status.

csplit – split a file into sections determined by context lines

A UNIX Command

$cat test.text
hello
how
are you ?
$csplit test.text 1
0
20
$cat xx00
$cat xx01
hello
how
are you ?
$rm xx*
$csplit test.text 2
6
14
$cat xx00
hello
$cat xx01
how
are you ?
$rm xx*
$csplit test.text 3
10
10
$cat xx01
are you ?
$cat xx00
hello
how
$csplit test.text 4
20
csplit: `4': line number out of range
$cat xx01
are you ?
$ls xx00
ls: cannot access xx00: No such file or directory
$


UNIX Explanation

Output pieces  of FILE  separated by PATTERN(s)  to files
`xx00', `xx01', ..., and output byte counts of each piece
to standard output.

truncate – shrink or extend the size of a file to the specified size

A UNIX Command

$cat example.text
hello
$ls -l example.text
-rw-r--r-- 1 jeffrin jeffrin 6 Jun 21 02:32 example.text
$truncate -s 10 example.text
$ls -l example.text
-rw-r--r-- 1 jeffrin jeffrin 10 Jun 21 02:35 example.text
$hexdump example.text
0000000 6568 6c6c 0a6f 0000 0000
000000a
$cat example.text
hello
$truncate -s 9 example.text
$ls -l example.text
-rw-r--r-- 1 jeffrin jeffrin 9 Jun 21 02:36 example.text
$hexdump example.text
0000000 6568 6c6c 0a6f 0000 0000
0000009
$

UNIX Explanation

`truncate' shrinks  or extends the  size of each  FILE to
the specified size.If a FILE is larger than the specified
size, the extra  data is lost.  If a  FILE is shorter, it
is extended and the extended part (or hole) reads as zero
bytes.

xwd – dump an image of an X window

A UNIX Command

$xwd -out ldump
$du -h ldump
1.4M	ldump
$hexdump -n 1 ldump
0000000 0000
0000001
$hexdump -n 5  ldump
0000000 0000 7600 0000
0000005
$hexdump -n 10   ldump
0000000 0000 7600 0000 0700 0000
000000a
$hexdump -n 50   ldump
0000000 0000 7600 0000 0700 0000 0200 0000 1000
0000010 0000 0004 0000 ad02 0000 0000 0000 0000
0000020 0000 2000 0000 0000 0000 2000 0000 1000
*
0000030
$

UNIX Explanation

Xwd is  an X Window  System window dumping  utility.  Xwd
allows  X users  to store  window images  in  a specially
formatted  dump file.   This  file can  then  be read  by
various  other  X   utilities  for  redisplay,  printing,
editing,  formatting, archiving,  image  processing, etc.
The target window is  selected by clicking the pointer in
the desired  window.  The keyboard  bell is rung  once at
the  beginning of  the dump  and twice  when the  dump is
completed.

sound: Fixed line limit issue in sound/ac97_bus.c


From a2c2867876c246420a199a0fb4c36ad2965a42cc Mon Sep 17 00:00:00 2001
From: Jeffrin Jose
Date: Mon, 6 Dec 2010 19:27:53 +0530
Subject: [PATCH] sound: Fixed line limit issue in sound/ac97_bus.c
This is a patch to the sound/ac97_bus.c file that fixes up a 80 character
line limit issue found by the checkpatch.pl tool.
Signed-off-by: Jeffrin Jose

---
sound/ac97_bus.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/ac97_bus.c b/sound/ac97_bus.c
index a351dd0..c93251a 100644
--- a/sound/ac97_bus.c
+++ b/sound/ac97_bus.c
@@ -19,9 +19,9 @@

/*
* Let drivers decide whether they want to support given codec from their
- * probe method. Drivers have direct access to the struct snd_ac97 structure and may
- * decide based on the id field amongst other things.
- */
+ * probe method. Drivers have direct access to the struct snd_ac97
+ * structure and may decide based on the id field amongst other things.
+*/
static int ac97_bus_match(struct device *dev, struct device_driver *drv)
{
return 1;
--
1.7.1

touch -c behaves incorrectly (non-POSIX)


http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439033

POSIX says about 'touch'[*]:

-c
    Do not create a specified file if it does not exist. Do not write
    any diagnostic messages concerning this condition.

[*] http://www.opengroup.org/onlinepubs/009695399/utilities/touch.html

But under some conditions, 'touch' writes a diagnostic message when
the file doesn't exist. For instance:

vin:~> mkdir dir
vin:~> chmod 000 dir
vin:~> /usr/bin/touch -c dir/file
/usr/bin/touch: setting times of `dir/file': Permission denied
zsh: exit 1     /usr/bin/touch -c dir/file
vin:~[1]>

Note that the BSD 'touch' does not have this problem, as shown by the
test below (under Mac OS X):

prunille:~> mkdir dir
prunille:~> chmod 000 dir
prunille:~> /usr/bin/touch -c dir/file
prunille:~>

Also the touch(1) man page doesn't say that no diagnostic messages
are written when the file doesn't exist. Users are not required to
look at the POSIX standard to get the full documentation.

Ditto for the manual (coreutils.info).

coreutils: ls –quoting-style=c and | (pipe) symbol


http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=432945

output of ls --quoting-style=c is incorrect when filename contains |
(pipe) symbol.

Steps:
  mkdir /tmp/bla
  touch "/tmp/bla/filename with | pipe"
  ls --quoting-style=c /tmp/bla

returns:

 "filename with \| pipe"

thanks,
-Mathieu

Ref:
http://groups.google.com/group/comp.lang.c/browse_thread/thread/0db8070def6a4453