01-10-2002
Makaveli.2003, that code works great for me.... Must be something wrong with your sed installation. Is it possible for you to re-install?
echo abcdef |sed -e "s/c/X/" <--should yield--> abXdef
Is the cut command working?
ls -ld filename |cut -c2-10 <--Should yield--> -rwxr-xr-x
(or something along those lines)
Also... it doesn't sound like your tr binary is working correctly either.
This line:
ls -ld somefilename | cut -c2-10 | /usr/bin/tr [-rwx] [0421]
Should be replace all '-' with zero's
all r's with 4's
all w's with 2's.... etc.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
when i list the content of a directory
date informations are also listed (ls -ltr)
for included files and directories.
for example: i see the date Jun 29 14:43
for one of the included directory,
but when i look into the files contained in
this directory i cannot see any file with this... (1 Reply)
Discussion started by: gfhgfnhhn
1 Replies
2. UNIX for Dummies Questions & Answers
hi,
say I have
dirA/file1
dirB/file2
and I tar them up, and then do
zcat Tar.tar | tar tvf -
Sometimes I will see:
dirA/
dirA/file1
dirB/
dirB/file2
yet other times I will see (4 Replies)
Discussion started by: JamesByars
4 Replies
3. UNIX for Dummies Questions & Answers
Hello All,
Got a question to make a script what reads a directory and put the file names from that directory in a file with some extra text.
ls /tempdir
output is:
file1.gfh
file2.txt
file4.zzz
these file names (always with an extention) must be placed in a line and written to... (2 Replies)
Discussion started by: ToXiQ
2 Replies
4. Shell Programming and Scripting
Hi all,
Have to generate an xml having information related to files in the directory
Suppose i have file
file1.xml (datafile)
file2.xml (datafile)
file3.xml (metafile)
Now i need to generate an xml in the format >>
<?xml version="1.0" encoding="UTF-8"?>
<AuditFile Version="2.0">... (8 Replies)
Discussion started by: abhinav192
8 Replies
5. Shell Programming and Scripting
Hi
i have a single line xml file having many account no tag, from which i need only the account no from the tag. any one can help on this.
below is the xml file:
... (2 Replies)
Discussion started by: Saravanapk
2 Replies
6. Shell Programming and Scripting
Hi to all,
I got this content/pattern from file http.log.20110808.gz
mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1
mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU
mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Discussion started by: Mr_47
16 Replies
7. Shell Programming and Scripting
Hi
I am trying to extract information out of a file but keep getting grep cant open errors
the code is below:
#bash
#extract orders with blank address details
#
# obtain the current date
# set today to the current date ccyymmdd format
today=`date +%c%m%d | cut -c24-31`
echo... (8 Replies)
Discussion started by: Bruble
8 Replies
8. UNIX for Dummies Questions & Answers
I need my code to compare two different files that are in two completely different directories, How can I do this?
So for example, my code will look at file1 which is in my home directory, and compare the files with those from file2 that is in /abc/adf/adr/afc/adf/file2... does that make sense? (1 Reply)
Discussion started by: castrojc
1 Replies
9. UNIX for Dummies Questions & Answers
I have a flat file that looks like this, let's call it Chromosome_9.txt:
FT /Gene_Name="Guanyl-Acetylase 9"
FT /Gene_Number"36952"
FT /Gene_Name="Endoplasmic Luciferase"
FT /Gene_Number"36953"
FT ... (4 Replies)
Discussion started by: Twinklefingers
4 Replies
10. Shell Programming and Scripting
Hi Gurus,
I am SQL developer and new unix user.
I need to create some file and file content based on information in two files.
I have one file contains basic information below file1 and another exception file file2. the rule is if "zone' and "cd" in file1 exists in file2, then file name is... (13 Replies)
Discussion started by: Torhong
13 Replies
xcutsel(1X) xcutsel(1X)
NAME
xcutsel - interchange between cut buffer and selection
SYNOPSIS
xcutsel [-toolkitoption...] [-selection selection] [-cutbuffer number]
OPTIONS
xcutsel accepts all of the standard X Toolkit command line options as well as the following: This option specifies the name of the selec-
tion to use. The default is PRIMARY. The only supported abbreviations for this option are "-select", "-sel" and "-s", as the standard
toolkit option "-selectionTimeout" has a similar name. This option specifies the cut buffer to use. The default is cut buffer 0.
DESCRIPTION
The xcutsel program is used to copy the current selection into a cut buffer and to make a selection that contains the current contents of
the cut buffer. It acts as a bridge between applications that do not support selections and those that do.
By default, xcutsel will use the selection named PRIMARY and the cut buffer CUT_BUFFER0. Either or both of these can be overridden by com-
mand line arguments or by resources.
An xcutsel window has the following buttons: When this button is pressed, xcutsel exits. Any selections held by xcutsel are automatically
released. When this button is pressed, xcutsel copies the current selection into the cut buffer. When this button is pressed, xcutsel
converts the current contents of the cut buffer into the selection.
The button labels reflect the selection and cutbuffer selected by command line options or through the resource database.
When the "copy 0 to PRIMARY" button is activated, the button will remain inverted as long as xcutsel remains the owner of the selection.
This serves to remind you which client owns the current selection. Note that the value of the selection remains constant; if the cutbuffer
is changed, you must again activate the copy button to retrieve the new value when desired.
X DEFAULTS
This program accepts all of the standard X Toolkit resource names and classes as well as: This resource specifies the name of the selection
to use. The default is PRIMARY. This resource specifies the number of the cut buffer to use. The default is 0.
WIDGET NAMES
The following instance names may be used when user configuration of the labels in them is desired: This is the "copy SELECTION to BUFFER"
button. This is the "copy BUFFER to SELECTION" button. This is the "quit" button.
BUGS
There is no way to change the name of the selection or the number of the cut buffer while the program is running.
SEE ALSO
X(1X), xclipboard(1X), xterm(1X), text widget documentation, individual client documentation for how to make a selection.
AUTHOR
Ralph R. Swick, DEC/MIT Project Athena
xcutsel(1X)