10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
I'm trying to calculate IP addresses and their respective calls to our apache Server. The standard format of the input is
HOST IP DATE/TIME - - "GET/POST reuest" "User Agent"
HOST IP DATE/TIME - - "GET/POST reuest" "User Agent"
HOST IP DATE/TIME - - "GET/POST reuest" "User Agent"
HOST... (2 Replies)
Discussion started by: busyboy
2 Replies
2. Shell Programming and Scripting
datafile:
blah,blah,blah,blah,blah,blah,blah,blah,blah=0_nblah=0-- ,blah,blah,blah
im using the following command to turn the "_n" and "-- " to just a space " " only in the $9th field. meaning, it has to make the changes only in the 9th column/field of the datafile.
awk -F, '{... (1 Reply)
Discussion started by: SkySmart
1 Replies
3. Shell Programming and Scripting
In the gawk below, I am trying to output the file tab-deliminated but don't think that is the correct syntax. Thank you :).
gawk OFS='/t' '{sub(/-+/,"",$2); ar=$0}
END{n = asort(ar)
for (i = 1; i <= n; i++)
print ar}' file (2 Replies)
Discussion started by: cmccabe
2 Replies
4. UNIX for Dummies Questions & Answers
Code :
echo "1,2,3,4"|awk -F "," 'NR==n{$3=a}1' n=1 a=45
Output :
1 2 45 4
Expected :
1,2,45,4 (4 Replies)
Discussion started by: Rajesh_us
4 Replies
5. Shell Programming and Scripting
I've been working on improving my awk, and the next thing I want to learn is to properly use functions (I understand functions in shell and python). I have the following code which includes how I did this without functions before, and two attempts I've made to do it with functions:
function... (3 Replies)
Discussion started by: DeCoTwc
3 Replies
6. Shell Programming and Scripting
Hi all,
Hoping someone hoping someone might be able to help. i've got the following sed command which i'm using in a bash script that i'm trying to use to insert a new line into an already existing file so i don't have to manually enter it when setting stuff up. the existing script test2/3 are... (3 Replies)
Discussion started by: springs2
3 Replies
7. Shell Programming and Scripting
Why the below option2 doesn't fetch similar output as option1 ? I am on linux.
$cat test
2013-01-01-00.25.43.643845
Option1:
cat test | gawk -F"-" ' {print $2 " " $3 " " $1}'
01 01 2013
Option2:
cat test | gawk '{FS="-"} {print $2 " " $3 " " $1}'
2013-01-01-00.25.43.643845 (5 Replies)
Discussion started by: Shivdatta
5 Replies
8. Ubuntu
Hi Team,
Please find below error. I got this after i done something in aptitude. Actually i was trying to update all packages, but unfortunately I removed all packages.
Now my server is down. When i boot it gives me me errors of missing .so files.
Is there any way to repair my server... (2 Replies)
Discussion started by: paragnehete
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
=============
In one of my config files, I have below command
eval echo RECORDDELIMITER '\n'
The above command results in removing backslash and outputs:
RECORDDELIMITER n
=============
Any workaround to retain the backslash after eval.
Appreciated for your... (10 Replies)
Discussion started by: axes
10 Replies
10. Shell Programming and Scripting
I have a script that reads from a file and deletes all files in tha path specified in the file.The problem,however, is the script also deletes itself from the home directory where I run it :-(
#!/bin/ksh
while read DAYS PURGE_PATH
do
cd $PURGE_PATH
find . \( -type d ! -name . -prune \)... (5 Replies)
Discussion started by: kayarsenal
5 Replies