Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #4K
~5K People Reached
Favorite Forums
Favorite Tags

11 Posted Topics

Member Avatar for programmer321

Hello, always mindboggled to see what handy options or builtins are there... Making it portable back to let's say Version 7 awk comes into mind: <code> awk 'BEGIN{ printf("%s\n", strftime("%Y%m%d", systime()-86400)) }' </code> Have fun, issue9

Member Avatar for cfajohnson
0
3K
Member Avatar for methopoth

[code] echo -n "Welcome to `hostname`. What is your name? " read LINE echo -n "Hello ${LINE}, how are you? " read LINE if test "${LINE}" = "good" then echo "I'm glad to hear that." else echo "I'm sorry to hear that. Hope you feel better soon" fi echo "Good-bye." …

Member Avatar for cfajohnson
0
139
Member Avatar for outkast

Hello Outkast, probably [url]http://unxutils.sourceforge.net[/url] could fit your needs... Cheers, issue9

Member Avatar for issue9
0
185
Member Avatar for reham84

Hello reham84, assuming paragraphs are separated by blank empty lines you might want to try this one: [code] awk 'BEGIN{ RS="" } { if(NR == 3){ printf("^L%s", $0) } }' fromfile >> anotherfile [/code] It should print a formfeed and the third paragraph from "fromfile" at the end of "anotherfile". …

Member Avatar for issue9
0
115
Member Avatar for modesto916

Hello modesto916, could you please provide some more details? It is a little bit hard to figure out exactly what you are asking for. Well, just guessing, but as a starting point let me assume having a file with incomplete IP addresses in a file called "iplist": cat iplist [code] …

Member Avatar for JeoSaurus
0
135
Member Avatar for roadwarrior

Probably the easiest way could be to pipe your file through grep(1). Assuming the file in question is named "YOURFILE" try cat YOURFILE | grep -v " " at your favorite shell prompt. Pls note the single blank between the double quotes.

Member Avatar for sknake
0
78
Member Avatar for srujanasadula

You might want to try [code] awk 'BEGIN{ str="'"${STR}"'" }{ buf=$0; gsub(/ /, "", buf) } buf ~ str { print }' a.txt [/code] which should print the "matched" line untouched.

Member Avatar for issue9
0
113
Member Avatar for Goddan

Please try [code] cat YOURFILE | sed 's/YOURSEARCH//g' > YOURFILE.tmp mv YOURFILE.tmp YOURFILE [/code] Just replace "YOURFILE" with the name of the file to search in and "YOURSEARCH" with the string you want to eliminate.

Member Avatar for issue9
0
283
Member Avatar for Goddan
Member Avatar for issue9
0
56
Member Avatar for srujanasadula

Hello srujanasadula, sorry for not providing a whole solution but here are some ideas: assuming the data to grep is in a file called "data" you might want to try this one [code] #!/bin/bash # # STR="yjava_jboss.log4j_file_appender_pattern_layout='%d .//- %x %-5p [%c] %m%n' " echo "-->${STR}<--" STR="`echo ${STR} |\ sed 's/\^/\\\^/ …

Member Avatar for srujanasadula
0
139
Member Avatar for contactnaveen

[code] #!/bin/bash # # cat 2.txt | while read LINE do BUF="`grep \`echo ${LINE} | awk '{ print $1 }'\` 1.txt`" if test $? -eq 0 then echo ${BUF} else echo ${LINE} fi done [/code]

Member Avatar for issue9
0
243

The End.