Search Results

Search: Posts Made By: LinuxRacr
2,654
Posted By Scott
Use a while loop: tail -1 "$LIST" | while...
Use a while loop:

tail -1 "$LIST" | while IFS=, read SERVER APPID OS APPDIR junk; do
echo $SERVER
: ...
done


A for loop will iterate its input one word at a time.

If you don't just...
853
Posted By rbatte1
Try:-ls -1 /somedirectory/*.log...
Try:-ls -1 /somedirectory/*.log /somedirectory/*.log.[0-1]You don't say that you want to do anything else with these files, so there is no context for us to suggest anything else at the moment.

It...
Forum: Solaris 03-13-2013
7,731
Posted By jlliagre
You can run this command: # echo ::kmastat |...
You can run this command:
# echo ::kmastat | mdb -k | grep file_cache
file_cache 56 337 1015 57344B 3009207 0
Here, 337 is the number of file descriptors in use...
1,886
Posted By rdrtx1
also try: awk -F: ' { s+=$3; m+=$2; h+=$1; } ...
also try:
awk -F: '
{ s+=$3; m+=$2; h+=$1; }
END {
if (int(s/60)>0) {m+=int(s/60); s=s%60;}
if (int(m/60)>0) {h+=int(m/60); m=m%60;}
printf "%03d:%02d:%02d\n", h, m, s;
}
' file1
2,006
Posted By Corona688
grep -v -F -f file1 file2 -F means 'fixed...
grep -v -F -f file1 file2 -F means 'fixed strings', to prevent it considering the contents of file1 as regexes.

$ grep -v -F -f file1 file2
server6:ERROR:user5: error message...
5,642
Posted By tukuyomi
INFO_CHK will keep '105,106,500' While in the...
INFO_CHK will keep '105,106,500'
While in the 'while' loop, a will be 105, then 106, then 500, so you can check inputs separately
After the 'done', INFO_CHK will still hold '105,106,500'
Hope it's...
5,642
Posted By tukuyomi
#!/bin/sh read INFO_CHK echo...
#!/bin/sh

read INFO_CHK

echo "$INFO_CHK" | sed 's/,/\n/g' | while read a; do
echo "$a"
# Do whatever you want with "$a"
done
The idea here is to convert ,(commas) with \n (new line) so...
5,642
Posted By Shell_Life
Here is one way of having the input parameters...
Here is one way of having the input parameters separated by comma:
#!/usr/bin/ksh
IFS=','
for mParm in $@
do
echo "mParm = <$mParm>"
done
3,264
Posted By Scott
With: for i in thingy do ...
With:


for i in thingy
do
some_command $i
done 2> /dev/null | tee $LOGFILE
1,465
Posted By guruprasadpr
Hi Considering the first two,(not sure about...
Hi
Considering the first two,(not sure about the output which you are expecting from the thrid)

INST_VER=`ssh server "swlist | grep -i program" | grep -v Running | awk '{print $1, $2}'`
...
26,299
Posted By guruprasadpr
Hi Assuming your list1 is in file1, list2...
Hi

Assuming your list1 is in file1, list2 in file2

grep -v -f file1 file2

Guru.
Forum: Cybersecurity 11-18-2009
4,251
Posted By pludi
TLS/SSL vulnerability explained
Here (http://blog.g-sec.lu/2009/11/tls-sslv3-renegotiation-vulnerability.html)'s a pretty good, and even PHB-compatible, explanation of the current TLS/SSl protocol vulnerability, including samples.
4,685
Posted By matrixmadhan
No need to redirect output of $? to a file "A"...
No need to redirect output of $? to a file "A" and then grep from that.
Instead use it directly in 'if' block

if [ $? -eq 0 ];
then
# stuff to do
fi
4,685
Posted By KimJensen
Hello there, thank you for the reply! I guess I...
Hello there,
thank you for the reply! I guess I didn't make myself clear.
I only need to test if the connection is up the 'aliveness' of the B
server is uninteresting at this point.

I have...
1,977
Posted By aigles
change="User_Alias SOME_ADMINS = user1" awk -v...
change="User_Alias SOME_ADMINS = user1"
awk -v c="$change" '
/User alias specification/{print c}
{ print }
' "file" > temp
mv temp file

Jean-Pierre
5,098
Posted By ghostdog74
change="User_Alias SOME_ADMINS = user1" awk -v...
change="User_Alias SOME_ADMINS = user1"
awk -v c="$change" '{print}
/User alias specification/{print c}
' "file" > temp
mv temp file
5,098
Posted By akdwivedi
As I stated above, it may not be the best...
As I stated above, it may not be the best approach. 'sed' searches for [search string] and replaces it with [replace string]

As per your requirement, you want the search string as well as the...
18,651
Posted By zazzybob
A slight variation on bhargav's script to ensure...
A slight variation on bhargav's script to ensure that only numeric digits are passed, and symbols as well as letters are rejected....

#!/bin/sh

echo "Enter number"
read val

if echo $val |...
18,651
Posted By bhargav
print -n "enter number - " read val echo...
print -n "enter number - "
read val

echo $val | grep "[a-zA-Z]"

if test $? -ge 1
then
if [[ $val -ge 1 && $val -le 100 ]] ; then
print "OK"
else
print "NOT in 1-100 range"...
124,191
Posted By Perderabo
Try this...typeset -Z6 number number=9 echo...
Try this...typeset -Z6 number
number=9
echo $number
((number=number+1))
echo $number
exit 0
Showing results 1 to 20 of 20

 
All times are GMT -4. The time now is 04:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy