Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Shell Programming and Scripting | Forum profile

Forum profile page for Shell Programming and Scripting on http://www.unix.com. This report page is the aggregated overview from a single forum: Shell Programming and Scripting, located on the Message Board at http://www.unix.com. This forum profile page summarizes the general forum statistics such as: Users Activity, Forum Activity, and Top Authors, which are reported in either a table or graph below for a given reporting time period. Additional forum profile information for "Shell Programming and Scripting" on the Message Board at http://www.unix.com is also shown in the following ways:

1) Latest Active Threads
2) Hot Threads for Last Week

Warning: These statistics are generated using 'best efforts' and can experience delays and reporting errors at times. Please note that such statistics do not constitute a forum's popularity and/or exact posting volumes at any given reporting period.

Site: The UNIX Forums - the Top UNIX & Linux Q&A on the Web - Shell Programming and Scripting (site profile, domain info unix.com)
Title: Shell Programming and Scripting
Url: http://www.unix.com/shell-programming-scripting/
Users activity: 34 posts per thread
Forum activity: 486 active threads during last week
 

Posting activity on Shell Programming and Scripting:

  Week Month 3 Months
Threads: 486 1,588 4,101
Post: 1,681 5,335 13,848
 

Shell Programming and Scripting Posting activity graph:

Posts by:  day  week  month 

Top authors during last week:

Name
Posts
Scrutinizer
114
user's latest post:
Sort command which ignores NULL...
Published (2009-11-26 05:45:00)
OK now I get what you are driving at. But IMO, the OP did not specify in his first post that there should be a sort on the second field too, plus in his last example he used only sort -u and said it was working fine. That is why I used sort -nu.
rdcwayx
75
user's latest post:
Deleting words between tags
Published (2009-11-26 05:41:00)
Code: awk '/<start>/,/<\/start>/' file.txt
aigles
57
user's latest post:
Picking high and low variables...
Published (2009-11-25 15:27:00)
You can do somthing like that : Code: c0=100 c1=12 c2=777 c3=1 clow=$c0 chigh=$c0 (( $c1 < $clow )) && clow=$c1 (( $c2 < $clow )) && clow=$c2 (( $c3 < $clow )) && clow=$c3 (( $c1 > $chigh )) && chigh=$c1 (( $c2 > $chigh )) && chigh=$c2 (( $c3 > $chigh )) && chigh=$c3 echo "Low : $clow"...
cfajohnson
49
user's latest post:
Calling Function Problem
Published (2009-11-21 12:32:00)
That script doesn't call either function.
Franklin52
45
user's latest post:
How to get date n months before...
Published (2009-11-25 15:23:00)
If you have GNU date you can do something like: Code: date -d "2 month ago" +%F otherwise you can check one of the links of: Yesterdays Date/Date Arithmetic
dennis.jacob
44
user's latest post:
need an AWK code: put in...
Published (2009-11-26 05:44:00)
Try: Code: awk '{ arr[$2]=arr[$2]" "$3; } END { for (i in arr) { print i" "arr[i] >>"Parallel_out"; split(arr[i],ar); printf "%s %.2f",i,(ar[1]+ar[2]+ar[3])/3 >>"avg_out"; }}' < file Output: cat avg_out Quote: 1.0 1.67 4.0 3.73 2.0 3.93 5.0 2.78 3.0 3.41 cat Parallel_out Quote: 1.0 4.00 0.00 1.00 4.0 4.40 4.40...
ghostdog74
41
user's latest post:
Extract a string from file -...
Published (2009-11-26 05:44:00)
Code: while read -r line do case "$line" in *barcode* ) li=${line##*barcode } line=${li%%)*} echo "$line" ;; esac done <"file"
scottn
37
user's latest post:
Extract a string from file
Published (2009-11-26 05:44:00)
Code: sed "s/.*barcode \(.\{6\}\).*/\1/" infile
frans
36
user's latest post:
Replacing tokens
Published (2009-11-26 05:46:00)
Thanks to TonyLawrence Code: YOURVAR=$(echo DateFileFormat | sed 's/\./.\\\\/g') our using backticks Code: YOURVAR=`echo DateFileFormat | sed 's/\./.\\\\/g'`
thegeek
32
user's latest post:
Help me with following issue...
Published (2009-11-25 15:29:00)
This is an excellent resource about how to use pv, and install pv in different platforms..... A Unix Utility You Should Know About : Pipe Viewer - good coders code, great reuse
 

Latest active threads on Shell Programming and Scripting::

The UNIX Forums - the Top UNIX & Linux Q&A on the Web
Started 14 hours, 5 minutes ago (2009-11-27 05:38:00)  by thegeek
from the man page, it is -p and not p. Code: -ep Don't create directories while extracting. -o+ Overwrite files when extracting. -o- Don't overwrite files when extracting. -p Decrypt archive using a password.
Thread:  Show this thread (2 posts)   Thread info: unrar multiple files with password Size: 611 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: unrar multiple files with password :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
The UNIX Forums - the Top UNIX & Linux Q&A on the Web
Started 14 hours, 42 minutes ago (2009-11-27 05:01:00)  by ghostdog74
Code: while IFS= read -r line do case "$line" in FHEAD*) echo "${line:0:19}$(date +%Y%m%d)${line:27}";; THEAD*) echo "${line:0:15}$(date +%Y%m%d)${line:23}";; *) echo "$line";; esac done <"file"
Thread:  Show this thread (3 posts)   Thread info: Search and replace particular characters in fixed length-file Size: 603 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Search and replace particular characters in fixed length-file :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
The UNIX Forums - the Top UNIX & Linux Q&A on the Web
Started 14 hours, 25 minutes ago (2009-11-27 05:18:00)  by thegeek
Quote: Originally Posted by sexyTrojan (it doesn't work somehow). Thanks in Do you get some errors ? Or no errors, and no expected behavior ( not copied also ? ). This executes cp for me in the remote server: Code: ssh root@192.168.1.33 "cp test-script /tmp/t.tttt" the test.script is ...
Thread:  Show this thread (2 posts)   Thread info: Copy a file on remote servers Size: 1,489 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Copy a file on remote servers :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
The UNIX Forums - the Top UNIX & Linux Q&A on the Web
Started 1 day, 3 hours ago (2009-11-26 16:39:00)  by radoulov
Code: awk > main.txt 'NR == FNR { n = split($0, t, "\047") fmt[NR] = t[4]; next } { for (i=1; i<=NF; i++) printf "%-*s", fmt[i], $i print "" }' config.txt temp.txt
Thread:  Show this thread (6 posts)   Thread info: How to put a word starting at particular position in a file using shell
scripting Size: 547 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: How to put a word starting at particular position in a file using shell
scripting :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
The UNIX Forums - the Top UNIX & Linux Q&A on the Web
Started 15 hours, 4 minutes ago (2009-11-27 04:39:00)  by popescu1954
steps: connection to server 2 cd /develp/temp ftp server1 send user, password cd /temp get file_name a.lst quit
Thread:  Show this thread (3 posts)   Thread info: File transfer from one server to another server in unix Size: 231 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: File transfer from one server to another server in unix :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
The UNIX Forums - the Top UNIX & Linux Q&A on the Web
Started 16 hours, 4 minutes ago (2009-11-27 03:39:00)  by pandu25
you can use any of the following. But don't put space between variable name and command. CONEXION_BAGDAD=`grep-c "Please login with USER and PASS" $ LOG_FILE_BAGDAD` CONEXION_BAGDAD=$(grep-c "Please login with USER and PASS" $ LOG_FILE_BAGDAD)
Thread:  Show this thread (3 posts)   Thread info: Trouble saving variable Size: 342 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Trouble saving variable :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
The UNIX Forums - the Top UNIX & Linux Q&A on the Web
Started 18 hours, 3 minutes ago (2009-11-27 01:40:00)  by honglus
I want to filter 2nd column = 2 using awk Code: $ cat t 1 2 2 4 $ VAR=2 #variable worked in print Code: $ cat t | awk -v ID=$VAR ' { print ID}' 2 2 # but variable didn't work in awk filter Code: $ cat t | awk -v ID=$VAR '$2~/ID/ { print $0}'
Thread:  Show this thread (3 posts)   Thread info: awk: assign variable with -v didn't work in awk filter Size: 1,108 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "awk: assign variable with -v didn't work in awk filter :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
The UNIX Forums - the Top UNIX & Linux Q&A on the Web
Started 1 day, 14 hours ago (2009-11-26 05:39:00)  by thegeek
in bash, it is one of the simplest way to form your file name ... Code: todaydate=`date +%d%m%Y` echo $todaydate file=imp_$todaydate echo $file output: Code: 25112009 imp_25112009 if you want to run it daily automatically, call it normally from cron.
Thread:  Show this thread (8 posts)   Thread info: Automatic file input to code Size: 860 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Automatic file input to code :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
The UNIX Forums - the Top UNIX & Linux Q&A on the Web
Started 1 day, 8 hours ago (2009-11-26 11:39:00)  by bigearsbilly
team members? are you people geting paid?
Thread:  Show this thread (7 posts)   Thread info: Problem with `cat` the compiled output of C program in unix Size: 122 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Problem with `cat` the compiled output of C program in unix :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
The UNIX Forums - the Top UNIX & Linux Q&A on the Web
Started 1 day, 14 hours ago (2009-11-26 05:40:00)  by dennis.jacob
You can use the find Ex: Code: find dir_name -type f -exec rm -f {} \; Awk doesn't haev any mechanism to delete file/files. However, you can make use of system("command").
Thread:  Show this thread (7 posts)   Thread info: Deleting files in awk Size: 538 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Deleting files in awk :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
 

Hot threads for last week on Shell Programming and Scripting::

Shell Programming and Scripting
Started 3 days, 20 hours ago (2009-11-23 23:34:00)  by mkastin
Code: $ echo "secret1 secret2 serect3" | awk '{gsub(/[a-z]/,""); print $0}' 1 2 3
Thread:  Show this thread (23 posts)   Thread info: Extract the letter from string Size: 425 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Extract the letter from string :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
Shell Programming and Scripting
Started 1 week, 2 days ago (2009-11-18 15:08:26)  by Franklin52
One way: Code: sed 's/^| |//' file > newfile
Thread:  Show this thread (18 posts)   Thread info: Remove first column from file Size: 471 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Remove first column from file :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
Shell Programming and Scripting
RE: Using GZIP command - 16 new posts
Started 6 days, 18 hours ago (2009-11-21 01:06:43)  by rdcwayx
for example, you need gzip a folder, Code: tar cvf - FOLDER_NAME |gzip > /PATH/Separete_file.tar.gz
Thread:  Show this thread (16 posts)   Thread info: Using GZIP command Size: 482 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Using GZIP command :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
Shell Programming and Scripting
help with script - 16 new posts
Started 1 week ago (2009-11-20 16:43:00)  by dsravan
I have a file which is comma delimited. I have around 35 fields in each row. The problem is in the 21st field I have data separated by “ ; ” I need the data in only the 21st field separated by “;” to be replaced by “|”. This is a very big file and I need something in awk that its much faster than regular commands. Can anybody tell exactly how I can only achieve this for 21st field.
Thread:  Show this thread (16 posts)   Thread info: help with script Size: 475 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "help with script :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
Shell Programming and Scripting
Started 1 week ago (2009-11-20 02:51:00)  by scottn
You can use quotes to preserve the newline. i.e. Code: echo " $files_found "
Thread:  Show this thread (15 posts)   Thread info: Issue with a file that contains CRLF Size: 483 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Issue with a file that contains CRLF :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
Shell Programming and Scripting
Started 1 week ago (2009-11-20 02:47:00)  by abhinav192
Hi all, In a script like : job_date=.... ls -l 2>/dev/null | awk -v var =$job_date ' /Name\.Version\.[0-9]+\.xml$/ { How can i include a script variable job_date store in "var" in the pattern " /Name\.Version\.[0-9]+\.xml$/ " Thanks in advance
Thread:  Show this thread (14 posts)   Thread info: Using a script variable in awk search patterns Size: 505 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "Using a script variable in awk search patterns :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
Shell Programming and Scripting
Started 1 week, 1 day ago (2009-11-19 12:10:00)  by ghostdog74
Code: awk -F"," 'NR==1{n=NF}NF<=n{n=NF}END{print n}' file
Thread:  Show this thread (13 posts)   Thread info: Count minimum columns in file - Page 2 - The UNIX and Linux Forums Size: 393 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "RE: Count minimum columns in file - Page 2 - The UNIX and Linux Forums :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
Shell Programming and Scripting
Started 1 week, 2 days ago (2009-11-18 12:08:46)  by cdunavent
I'd like to create a report that is sent to me via email. It's basically just an ls -l of a directory. However, I'd like to add a column to the end of each file listing that is a numeral - telling me at a glance how old the file is. For example, instead of this: $ ls -l total 9830796 -rw-r--r-- 1 voicem voicem 2011396608 Oct 21 03:06 file1....
Thread:  Show this thread (16 posts)   Thread info: Add column that shows how old a file is Size: 1,346 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "Add column that shows how old a file is :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
Shell Programming and Scripting
Started 1 week, 1 day ago (2009-11-18 21:06:48)  by achak01
Friends, I have to find out the greatest amoings three values using awk. Actually i have to run the iostat -d command on my linux box for 5 or 6 iterations and print the largest value for tps at each iteration for e.g Code: iostat -d 3 3 Linux 2.6.18-8.el5 (abhijit) 11/19/2009 _i686_ (2 CPU) Device: tps Blk_read/s ...
Thread:  Show this thread (13 posts)   Thread info: Need to find the greates value using AWK. Size: 1,877 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "Need to find the greates value using AWK. :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."
Shell Programming and Scripting
Started 1 day, 14 hours ago (2009-11-26 05:41:00)  by justbow
Hi, i have the log attached. Actually i want the long space just become 1 space left like this : Quote: 20091116 08:29:18+0800 8540 "pmain" 32.50 8.90 541809 1720080 1472264 4 12.00 20091116 08:29:18+0800 4662 "pmain" 22.10 3.10 1210 613864 511748 3 28.00 20091116 08:29:18+0800 8506 "pmain" 32.90 9.30 548538 1830624 1535508 2 28.00 20091116 08:29:18+...
Thread:  Show this thread (13 posts)   Thread info: Replace long space to become one space? Size: 2,197 bytes
Related Threads: Same Site | All Sites
Customize:  Customize "Replace long space to become one space? :: Shell Programming and Scripting :: The UNIX Forums - the Top UNIX & Linux Q&A..."