10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello,
Giving those commands:
cat > myfile
1
2
3
^D
cat myfile | awk '{ s=s+$1 ; print s}'
The output is:
1
3
6
It seems like this command iterates each time on a different row so $1 is the first field of each row.. But what caused it to refer to each row ?.
What I mean... (3 Replies)
Discussion started by: uniran
3 Replies
2. Shell Programming and Scripting
I created 3 files with the identical data as follows
dial-peer voice 9999 pots
trunkgroup CO
list outgoing Local
translation-profile outgoing LOCAL-7-DIGITS-NO-PREPEND-97
preference 2
shutdown
destination-pattern 9......$
forward-digits 7
dial-peer voice 10000 pots
... (6 Replies)
Discussion started by: popeye
6 Replies
3. UNIX for Dummies Questions & Answers
Hello,
And when you think you know the basics of something, UNIX in this case, something like what I will describe below comes along....
On a Linux system, a "typical" directory with some files. Say 20.
I do:
> ls | sort > mylisting
Now when I:
> vi mylisting
There is mylisting... (13 Replies)
Discussion started by: stavros
13 Replies
4. Shell Programming and Scripting
This is my command
echo "Test" | sed -f <(sed -e 's/.*/s,&,gI/' mydic)
In mydic file,containing 2 columns delimit by comma (,)
a,AlphabetA
.
.
.
e,AlphabetE
.
.
s,AlphabetS
.
t,AlphabetT
test,testedd
.
.
zebra,zebraaaa
The expect result is testedd (0 Replies)
Discussion started by: Runicer
0 Replies
5. Shell Programming and Scripting
I have been living with this problem with GNU sed v4.1.4 for a long time, but now I really need to figure it out.
When using a list in either an address or a search, the expression is matching lower and upper-case letters. works as it should.
For example, if I run
sed -nr "// p"... (7 Replies)
Discussion started by: nctrader
7 Replies
6. Shell Programming and Scripting
I hv a file --am executing a script which is giving me unexpected results
COntents of file:
f1
CMT_AP1_CONT:/opt/sybase/syboc125:150:ASE12_5::Y:UX:
CMT_AP1:/opt/sybase/syboc125:150:ASE12_5::Y:UX
f1.tmp
CMT_AP1_CONT:/opt/sybase/syboc125:150:ASE12_5::Y:UX:... (2 Replies)
Discussion started by: rajashekar.y
2 Replies
7. Shell Programming and Scripting
Hi All,
How can i take the following code having three seds into a variable :
echo "$DateFileFormat" | sed 's/\./\\\\./g' | sed 's/\$/+/g' | sed 's/\#/'$job_date'/g'
I want to get the result stored in a script variable
i tried
var2=`echo "$DateFileFormat" | sed 's/\./\\\\./g' |... (4 Replies)
Discussion started by: abhinav192
4 Replies
8. Shell Programming and Scripting
Hi all, this is my first post so go gentle.
My goal is to use SED to add data to the end of lines in a file, then send the results to standard output. However, I want to add the result of another command to the end of the lines.
Basically:
sed 's/$/ insert command stuff here/' file.txtHere... (1 Reply)
Discussion started by: jsmith_4242
1 Replies
9. Shell Programming and Scripting
Hi All,
I probably miss something fundamental here.
I want to rename a bunch of files in subdirectories (that might contain white spaces) with names that are related.
I thought following could do the job:
find . -name *.sh -exec mv {} $(echo {} | sed -e 's/0/1/g') \;
Now to be able to... (5 Replies)
Discussion started by: blued
5 Replies
10. Programming
hello,
i use this command in my code:
(void) sprintf ( LBuf, "/bin/sed 's/\\//g' %s > %s", tmp1,tmp2);
but i get this error :
sh: syntax error at line 1:'end of file' unexpected
any help please
thank you (1 Reply)
Discussion started by: kamel.seg
1 Replies