so i tried using the code below to modify my script, but i got the same thing, no syntax and no output, i think the mistake is in the way i try to write to the logfile
my "who" command outputs 5 fields:
- username
- terminal
- date
- time
- ip
i think (cut -d" ") deals with each space " " as a separate field, so that's why i end up using 13, 14. I'm sure someone mentioned that in a reply to one of my posts
here is an output from my ./temp file, which is exactly the same as my "who" output
haha, i was looking for the person who said it to quote him and for some reason i read all the previous replies except yours
can you please explain the code you wrote down,
- what are the variables after the "while read"?
- how does this code write the name, date and ip to the logfile?
haha, i was looking for the person who said it to quote him and for some reason i read all the previous replies except yours
can you please explain the code you wrote down,
- what are the variables after the "while read"?
- how does this code write the name, date and ip to the logfile?
The variables represent the five output fields of your who command (_junk is just to pick everything else up should there be more fields).
I replaced your echo -n with printf because it's non-standard (actually, truthfully because it doesn't work on AIX, where I wrote this )
The rest is much the same as you had, except that the values are read without the need to cut up the line.
Hello,
I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time.
My script:
returned=`tail -50 SapLogs.log | grep -i "Error"`
echo $returned
if ; then
echo "There is no errors in the logs"
fi
And after... (10 Replies)
Hi All,
Please could anyone advise what the purpose of the dot syntax in the following command means:
tar -cvf ${WORKING_BACKUP_ROOT}/${TAR_ARCHIVE_FILE} . >/${BACKUP_ROOT}/${ARCHIVE_LOG}
Many thanks (2 Replies)
I am trying to add a line to a BASH shell script to print out a large variable length table on a web page. I am very new to this obviously, but I tried this with awk and it prints out every line twice. What I am doing wrong?
echo "1^2^3%4^5^6%7^8^9%" | awk 'BEGIN { RS="%"; FS="^"; } {for (i =... (6 Replies)
I'm trying to output the contents of the infile to the outfile using Append.
I will want to use append but the syntax doesn't seem to be working !
Input file (called a.txt) contains this:
a
a
a
b
b
b
I'm running shell script (called k.sh) from Unix command-line like this:
./k.sh .... (1 Reply)
Hello to everybody...
I have spent very long time on this before I decided to sign up in this forum.
Maybe I've just not used the right keywords. I have to say that I'm not a programmer or something like that...
I've been playin' around a little with ImageMagick and I would like to have... (4 Replies)
Hello Unix Gurus,
I need a few instuructions how to approach the following scenarios.For a given TABLENAME a script should display the following
structure on the screen.The structure should be as below.for a given perticular table.
SELECT *FROM TAB1 a JOIN
TAB1 b ON
... (0 Replies)
Hi All
I am quite new to Unix. Following is a shell script that i have written and getting the subject mentioned error.
#!/bin/ksh
#-------------------------------------------------------------------------
# File: ang_stdnld.ksh
#
# Desc: UNIX shell script to extract Store information.... (3 Replies)
--------------------------------------------------------------------------------
Hello, help me please.
I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? :
Command : failed stdout: yes stderr: no... (9 Replies)
hi there
i write one awk script file in shell programing
the code is related to dd/mm/yy to month, day year format
but i get an error
please can anybody help me out in this problem ??????
i give my code here including error
awk `
# date-month -- convert mm/dd/yy to month day,... (2 Replies)