09-11-2008
echo " Enter the dir name: [Give full path] "
read dir
cd $dir
for file in `ls`
do
if [ -f $file ]; then # Plz try to check & avoid *.gz , *.out & *.4ge
# and other binary files
echo `cat $file`> $file
fi
done
Last edited by Niroj; 09-11-2008 at 09:09 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a file with on one line a uid, and on the next line a date. I am trying to make the to into one line.
Here's an example:
koppx
20031125
kraan
20031119
sarox
20031107
And this is what i want it to be:
koppx;20031125
kraan;20031119
sarox;20031107
I have been trying... (4 Replies)
Discussion started by: tine
4 Replies
2. Shell Programming and Scripting
Hi All,
I have output like this in one file.
IFName: aust00m1.mis.amat.com ]
ObjID: 5eceea48-0d59-71dd-1512-9887a1f10000
IFAlias: Dest: AMNA austkchr1-ser0/0/0:0.315 Type: FRASI CID: DHEC.559128
IFDescription: ATM9/1/0.315-atm subif
Status: Normal
IFName: aust00m1.mis.amat.com ]
ObjID:... (3 Replies)
Discussion started by: ntgobinath
3 Replies
3. Shell Programming and Scripting
input1
x
x
input2
y
x
x
z
join input1 input2>>output
ouput
x
x (2 Replies)
Discussion started by: repinementer
2 Replies
4. Shell Programming and Scripting
Hi All,
Currently, the output looks like this:
hdisk0
queue_depth:3
hdisk1
queue_depth:3
hdisk2
queue_depth:1
hdisk3
queue_depth:1
I need to change the format to look like this:
hdisk0 queue_depth:3
hdisk1 queue_depth:3
hdisk2 queue_depth:1 (8 Replies)
Discussion started by: Beginer0705
8 Replies
5. Shell Programming and Scripting
hi all i have sample and i need script to do this
/dev/xxx oracle test
/dev/sap
9999 000 88 99
i need the out put like this
/dev/xxx oracle test
/dev/sap 9999 000 88 99
can any one provide me with an idea to solve this problem (8 Replies)
Discussion started by: maxim42
8 Replies
6. Shell Programming and Scripting
I want to join this two lines but only when after him
I have nothing or a comma
Yes, I know Jonesy, and I'll give him
about one more minute.
this two lines must become
Yes, I know Jonesy, and I'll give him about one more minute.
thank you very much (11 Replies)
Discussion started by: thailand
11 Replies
7. Shell Programming and Scripting
I have a file like this:
---------------------------------------------------------------
26
00:04:48,440 --> 00:04:51,440
I don't know why he can't just do
the Great Apache Flaming Arrow Act.
27
00:04:52,440 --> 00:04:54,839
Didn't you tell him
to use the gopher snake?
28... (1 Reply)
Discussion started by: thailand
1 Replies
8. Shell Programming and Scripting
Hi
I have a source file ( written i C ) where a funtion call is spread over multiple lines, for example :
func(
a,
b,
c
);
I want this to be joined into one single line :
func(a,b,c);
How can this be done with awk and sed ?
Regards. Hench (2 Replies)
Discussion started by: hench
2 Replies
9. UNIX for Dummies Questions & Answers
Hello UNIX gurus, I am new to the world of UNIX. Hopefully I am submitting my question at the right forum. Here is my dilemma -
I have a file with contents like this -
"line1","Hello","World","Today is a wonderful day","yes it is"
"line2","Hello","World","Today is a
beautiful day","oh... (8 Replies)
Discussion started by: foolishbar
8 Replies
10. Shell Programming and Scripting
Hi
how do I join files like below in script.
Thanks,
Ashan
there are may line like this in the file.
zone name DR_TMP_A_sev1_3eA vsan 200
pwwn 50:00:09:73:f0:16:35:08
pwwn c0:50:76:08:6e:dc:00:16
zone name DR_TMP_A_SVR2_3eA vsan 200
pwwn 50:00:09:73:f0:16:35:08
pwwn... (4 Replies)
Discussion started by: ashanabey
4 Replies
LEARN ABOUT CENTOS
tk_getjoinstyle
Tk_GetJoinStyle(3) Tk Library Procedures Tk_GetJoinStyle(3)
__________________________________________________________________________________________________________________________________________________
NAME
Tk_GetJoinStyle, Tk_NameOfJoinStyle - translate between strings and join styles
SYNOPSIS
#include <tk.h>
int
Tk_GetJoinStyle(interp, string, joinPtr)
const char *
Tk_NameOfJoinStyle(join)
ARGUMENTS
Tcl_Interp *interp (in) Interpreter to use for error reporting.
const char *string (in) String containing name of join style: one of "bevel", "miter", or "round".
int *joinPtr (out) Pointer to location in which to store X join style corresponding to string.
int join (in) Join style: one of JoinBevel, JoinMiter, JoinRound.
_________________________________________________________________
DESCRIPTION
Tk_GetJoinStyle places in *joinPtr the X join style corresponding to string, which will be one of JoinBevel, JoinMiter, or JoinRound. Join
styles are typically used in X graphics contexts to indicate how adjacent line segments should be joined together. See the X documentation
for information on what each style implies.
Under normal circumstances the return value is TCL_OK and interp is unused. If string does not contain a valid join style or an abbrevia-
tion of one of these names, then an error message is stored in interp->result, TCL_ERROR is returned, and *joinPtr is unmodified.
Tk_NameOfJoinStyle is the logical inverse of Tk_GetJoinStyle. Given a join style such as JoinBevel it returns a statically-allocated
string corresponding to join. If join is not a legal join style, then "unknown join style" is returned.
KEYWORDS
bevel, join style, miter, round
Tk Tk_GetJoinStyle(3)