12-07-2013
Yoda is right, there are better ways to achieve what you want, but setting IFS to "," and getting the cut command right will make your code snippet fly.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Have the following lines in a script: echo "-----------------------------------------------"\
"---------------------" >> $xdfrpt
echo "- Date - - / - /stand - /u - /u1 - /u2 -"\
"/x1 - /x2 - /x3 -" >> $xdfrpt
echo... (1 Reply)
Discussion started by: Cameron
1 Replies
2. Shell Programming and Scripting
Hi,
I have given the following statement in a script to put the values of variables (VAR1, VAR2,...) in a file.
echo " $VAR1 $VAR2 $VAR3 $VAR4 $VAR5" >> filename
But the output is not coming properly. Variables VAR5, VAR4 are replacing the first (VAR1, VAR2,..). I can't... (5 Replies)
Discussion started by: abrd600
5 Replies
3. Shell Programming and Scripting
echo "XXXXX" >> /xx/output.txt
cat /xx/file.txt| awk '{tony=tony+$1+$2; print tony/$3*100}' >> /xx/output.txt
Dear all,
In this situation i will have 2 lines in the output file. What i want is to have only one output line. e.g: XXXXX "value"
HOW to put the output of the "cat and awk" in... (1 Reply)
Discussion started by: tontal
1 Replies
4. UNIX for Dummies Questions & Answers
Hi
I am using tcsh.
I want display in a file_1 like this.
$VARIBALE
I gave in a termianl
> echo "\$VARIBALE" > file_1
Its not workning.
It was giving VARIBALE: Undefined variable.
I gave \ before $, but why it was giving undefined varible?
Please help me.
Thanks in advance (4 Replies)
Discussion started by: chaitubek
4 Replies
5. Shell Programming and Scripting
Hi All,
Hope someone can advise here as I have been struggling to find a syntax that works here. I have tried a stack of combination I have seed in the forums but I think because I have needed to use "" and `` in the statments another method is found.
I am reading in lines with the following... (1 Reply)
Discussion started by: nkwilliams
1 Replies
6. Shell Programming and Scripting
Hello all,
Please help with the below.
I have a requirement where in I have to read a pattern and print it as shown below.
Patterns will be as below.
Input Output
Pattern Should be printed as below with spaces such that I can awk.
-*--* - * - - *
*--**... (2 Replies)
Discussion started by: tenderfoot
2 Replies
7. Shell Programming and Scripting
I am new to the c shell script, can you let me know why the set rr= is not working.
C shell script
#! /bin/csh
Set tt= 12345_UMR_BH452_3_2.txt
set rr='echo $tt | cut –d”_” -f1'
syntax error (4 Replies)
Discussion started by: jdsignature88
4 Replies
8. Shell Programming and Scripting
Hi,
I am cutting data from a fixed length test file and then writing out a new record using the echo command, the problem I have is how to stop multiple spaces from being written to the output file as a single space.
Example:
cat filea | while read line
do
field1=`echo $line | cut -c1-2`
... (6 Replies)
Discussion started by: dc18
6 Replies
9. Shell Programming and Scripting
hi all
i have little problem below is my shell script
a=`sqlplus fss_cst/fss_cst@dolp1 << EOF
SET PAGESIZE 0 FEEDBACK OFF TRIMOUT ON;
select process from lfs$ta_process where valid_to_dat=to_date('9/16/2010','mm/dd/yyyy');
EOF`
echo ${SQL}
the script name is test2.sh
when i execute... (5 Replies)
Discussion started by: aishsimplesweet
5 Replies
10. Shell Programming and Scripting
Hey all! I'm in an intro to UNIX class at university, and we've just began writing scripts. Naturally I can't get it to do what I want.
Basic script as follows:
COMPARE1=`ls|wc -l`
tar czf archive.tgz ~/path/to/file
COMPARE2=`tar tvzf archive.tgz|wc -l`
if
then
... (7 Replies)
Discussion started by: nickzourdos
7 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)