10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Like I have below string
XX_49154534_491553_201_122023_D
XX_49159042_491738_201_103901_D
and the expected output would be
0154534
0159042
XX and 49 can be dynamic. (1 Reply)
Discussion started by: nadeemrafikhan
1 Replies
2. Shell Programming and Scripting
Dear Awk Experts,
I can write oneliner some time but find difficulty writing like a flow of a program in multiple lines,
could you please help how to write awk program , like long awk programs, any help to start with,
For example,
How to write this in multiple line:
ls -l | awk... (6 Replies)
Discussion started by: rveri
6 Replies
3. Shell Programming and Scripting
Hello,
I was trying to split a string to characters by perl oneliner.
echo "The quick brown fox jumps over the lazy dog" | perl -e 'split // ' But did not work as with bash script pipe:
echo "The quick brown fox jumps over the lazy dog" | fold -w1 | sort | uniq -ic 8
1 T
1... (6 Replies)
Discussion started by: yifangt
6 Replies
4. Shell Programming and Scripting
Hi,
I need to replace the ip 1.1.1.1 with the name test.sol.box . I have tried and come up with following code.
do we have any other way of doing this with nawk??
Data:
#This is a test setup.Please enter your values and corresponding port number here
##########################
Server Host... (5 Replies)
Discussion started by: chidori
5 Replies
5. UNIX for Dummies Questions & Answers
for example, i have a file with below content:
123413
866688
816866
818818
i want the output as:
This is header
123413
866688
816866
818818
This is trailer
i am able to achieve it using a bash script. (2 Replies)
Discussion started by: pandeesh
2 Replies
6. Shell Programming and Scripting
can any one suggest some one liner such that when executed will display df -h output of the mount points that are 90% or more that it.. and not the remaining.. (7 Replies)
Discussion started by: chidori
7 Replies
7. Shell Programming and Scripting
I am trying to take first 3 columns in a file which matches the word "abc", but i am getting the below error,
<error>
Global symbol "@F" requires explicit package name at ./new.pl
</error>
whereas when i give the below,grep abc /home/test/file.txt|perl -lane 'print \"$F $F $F\" in unix prompt... (4 Replies)
Discussion started by: anspks
4 Replies
8. Shell Programming and Scripting
I want to create new file for START-END
but i know NO 0003/02 only one in file
Ex. Data FILE Data.txt (Data ~1,000,000 Line)
I use Script perl
perl -lne '$/="END";print $_."END" if /0003\/02/' fileOut put script perl
but I want create Out put All No in START-END have NO 0003/02 Please... (8 Replies)
Discussion started by: kittiwas
8 Replies
9. Shell Programming and Scripting
hello mighty all
there's a file with lots of comments.. some of them looks like:
=comment
blabla
blablabla
bla
=cut
i'm trying to cut this out completely with this code:
$line=~s/^=.+?=cut//sg;
but no luck
also tryed to change it abit but still I don't understand how the... (9 Replies)
Discussion started by: tip78
9 Replies
10. Shell Programming and Scripting
is this possible a one liner sed command.
I have a text file ex.
from :
xxx yyy ZZZ /test/devl/aasdasd.log1
xxx yyy ZZZ /test/devl/aasdasd.log2
to :
xxx yyy ZZZ /test/prod/aasdasd.log1
xxx yyy ZZZ /test/prod/aasdasd.log2
and I want to sed only the fourth column
sed 's/devl/prod/g' ... (8 Replies)
Discussion started by: chaseeem
8 Replies