Tag Archives: FILES

vnc version question

By bitlord

Hello,
Help me understand this. I’m on a Solaris 10 server with VNC installed on it. VNC comes installed by default on Solaris 10. I ‘m tiring to see if the system has the latest version of VNC installed.
The package for VNC on Solaris is SUNWxvnc

Code:

pkginfo -l SUNWxvnc
PKGINST: SUNWxvnc
NAME: X11/VNC server
CATEGORY: system
ARCH: sparc
VERSION: 6.6.2.0500,REV=0.2008.02.15
BASEDIR: /usr
VENDOR: Sun Microsystems, Inc.
DESC: X Window System server based on X.Org Foundation open source release and RealVNC open source release that displays over RFB protocol to a VNC client
PSTAMP: x10s20080515125558
INSTDATE: Nov 02 2012 08:50
HOTLINE: Please contact your local service provider
STATUS: completely installed
FILES: 22 installed pathnames
7 shared pathnames
11 directories
4 executables
1 setuid/setgid executables
8838 blocks used (approx)


On the real VNC site it shows that vnc there latest version of VNC for Solaris is 5.0.5. So basicly how do figure out what version I have?

From: http://www.unix.com/solaris/221423-vnc-version-question.html

Need help for Curl package

By manalisharmabe

Hi all,

I need the same curl package installed on system1 to be installed on other system2. Both machines are Solaris 10

System1:

Code:

-bash-3.00$ pkginfo | grep curl
system SFWcurl curl - tool for transfering data specified with URL syntax


Code:

-bash-3.00$ pkginfo -l SFWcurl
PKGINST: SFWcurl
NAME: curl - tool for transfering data specified with URL syntax
CATEGORY: system
ARCH: sparc
VERSION: 7.19.5,REV=2009.08.23.06.12
BASEDIR: /opt
VENDOR: curl and libcurl
DESC: curl - tool for transfering data specified with URL syntax
PSTAMP: freeware20090825021108
INSTDATE: Mar 15 2010 11:05
HOTLINE: Please contact the owners of this software
STATUS: completely installed
FILES: 75 installed pathnames
8 directories
3 executables
2537 blocks used (approx)
-bash-3.00$


system2:

Code:

-bash-3.2$ pkginfo | grep curl
application SMCcurl curl
-bash-3.2$


Code:

-bash-3.2$ pkginfo -l SMCcurl
PKGINST: SMCcurl
NAME: curl
CATEGORY: application
ARCH: sparc
VERSION: 7.19.7
BASEDIR: /usr/local
VENDOR: The Curl Group
PSTAMP: Steve Christensen
INSTDATE: Apr 10 2013 18:08
EMAIL: steve@smc.vnet.net
STATUS: completely installed
FILES: 335 installed pathnames
9 shared pathnames
14 directories
4 executables

Source: FULL ARTICLE at The UNIX and Linux Forums

Redirect Standard Error to /dev/null is not working.

By jimbojames

Hello.

When I run a .ksh that contains the command below, and there is no file available in the source location the “FILE_NAME_*.CSV not found” error is still being displayed.

Code:

FILEN=$(ssh ${SOURCE_SERV} "cd ${SOURCE_LOCATION} ;ls ${FILES}") 2> /dev/null


.

This is interfering with the rest of the script, as it is not exiting as required, and is continuing to the next command (See below).

Code:

echo "- Listing available file(s) on ${SOURCE_SERV}${SOURCE_LOCATION}:n"
FILEN=$(ssh ${SOURCE_SERV} "cd ${SOURCE_LOCATION} ;ls ${FILES}") 2> /dev/null
print ${FILEN}
if [ $? -eq 0 ]; then
echo "n- End of Source of files list."
else
echo "tt#####################################ntt# NO FILES AVAILABLE. #ntt#####################################nnn- Exiting script"
exit 0
fi


Can anyone advise what I am doing wrong with the redirection? Basically If there are no files available, I need to echo the warning and exit the script successfully.

Thanks in advance.

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Version of OpenSSL being used

By CHoggarth

Hello

I’m relatively new to technologies like Apache & ssl but have some years
experience with Unix. My question concerns the version of OpenSSL which is
genuinely being used on our server & how is that set.

The server is running Solaris 10. I’ll show output from various commands:

Code:

:/usr/local/ssl # pkginfo -l SMCossl
PKGINST: SMCossl
NAME: openssl
CATEGORY: application
ARCH: sparc
VERSION: 1.0.1c
BASEDIR: /usr/local
VENDOR: The OpenSSL Group
PSTAMP: Steve Christensen
INSTDATE: Aug 17 2012 07:27
EMAIL: steve@smc.vnet.net
STATUS: completely installed
FILES: 1871 installed pathnames
1 shared pathnames
43 directories
32 executables
30745 blocks used (approx)

:/usr/local/ssl #


Code:

:/usr/local/ssl # openssl version -a
OpenSSL 1.0.1c 10 May 2012
built on: Sun May 13 18:44:13 EDT 2012
platform: solaris-sparcv9-gcc
options: bn(64,32) rc4(ptr,char) des(idx,cisc,16,long) idea(int) blowfish(ptr)
compiler: gcc -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -
DDSO_DLFCN -DHAVE_DLFCN_H -m32 -mcpu=ultrasparc -O3 -fomit-frame-
pointer -Wall -DB_ENDIAN -DBN_DIV2W -DOPENSSL_BN_ASM_MONT -DSHA1
_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DGHASH_ASM
OPENSSLDIR: "/usr/local/ssl"
:/usr/local/ssl #


But if I run telnet xxx.xxx.xxx.xxx 80 & OPTIONS / HTTP1.0 from our network it reports 0.9.8x:

Code:

HTTP/1.1 200 OK
Date: Tue, 19 Feb 2013 10:20:37 GMT
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8x DAV/2
Allow: POST,OPTIONS,GET,HEAD
Vary: Accept-Encoding
Content-Length: 0
Connection: close
Content-Type: text/html

Connection to host lost.

W:>


I’ve been advised to use OPTIONS / HTTP1.0 to determine which version is genuinely being used.

We have in the past installed SSL by package (the most recent being 1.0.1) & source (presumably the most recent being 0.9.8x).

I need to upgrade SSL on this server & I would like to use the 1.0.1 stream (I understand packages are more likely to be available for this & that’s certainly easier to install). But I can’t figure out why the system is really using 0.9.8x when the server itself is saying that 1.0.1 is being used.

I am assuming that the OPTIONS / HTTP1.0 command is giving me the true version.

Can anyone clarify what might be happening & advise how I can start using 1.0.1?

Thanks, Chris

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Find and split the list of files with suffiz of seg**

By Satish Shettar

Hi,.

I am writing a script to get the new files and split them.

Requirement
Find the new files under the path “/wload/scmp/app/data/OAS” (There are 5 sub folders).
Gunzip the files which are having .gz suffix.
Put the list of files in the filename in the format “fiels_to_split_2013012911300.txt where as the numeric part is date and time.
Perform the split command on the files to split each file containing 50000 lines.
The output of the split filename should have the same file with suffix seg** where ** can be either numbers or alphabets.

I got the code from Pikk45 and tried to add/modify as per the need.

find /wload/scmp/app/data/OAS -name “*.gz” -size +100000000 -type f -mtime -1 -exec gunzip {} ;
FILENAME=new_fiels_to_split$(date +”%Y%m%d%H%M”).txt
find /wload/scmp/app/data/OAS -type f -mtime -1 > /wload/scmp/app/data/OAS/$FILENAME
FILES=/wload/scmp/app/data/OAS/$FILENAME
FIRST=1
FILE=1
SPL=50000
while read file; do
if [ -e “${FILE}” ]; then
while [ $SPL -le `wc -l $FILES`]
do
sed -n ‘$FIRST,$SPLp’ $FILES > $FILES.seg{$FILE}
fi
done < ${FILES}
FIRST=`expr $FIRST + 50000`
SPL=`expr $SPL + 50000`
FILE=`expr $FILE + 1`
done

for example
the source files


-rw-rw-r– 1 scmpadm scmpuser 755861762 Jan 26 20:04 activity.log.20130125.gz
-rw-rw-r– 1 scmpadm scmpuser 0 Jan 26 20:05 trigger.activity.log.20130125
-rw-rw-r– 1 scmpadm scmpuser 913911244 Jan 27 20:24 activity.log.20130126.gz
-rw-rw-r– 1 scmpadm scmpuser 0 Jan 27 20:25 trigger.activity.log.20130126
-rw-rw-r– 1 scmpadm scmpuser 329351168 Jan 28 19:10 activity.log.20130127.gz

After gunzip

-rw-rw-r– 1 scmpadm scmpuser 3012939863 Jan 28 19:10 activity.log.20130127

Files after split

-rw-rw—- 1 scmpadm scmpuser 49877675 Jan 29 07:04 activity.log.20130127.segaa
-rw-rw—- 1 scmpadm scmpuser 47552800 Jan 29 07:07 activity.log.20130127.segab
-rw-rw—- 1 scmpadm scmpuser 45867421 Jan 29 07:08 activity.log.20130127.segac
-rw-rw—- 1 scmpadm scmpuser 48985303 Jan 29 07:09 activity.log.20130127.segad
-rw-rw—- 1 scmpadm scmpuser 50846638 Jan 29 07:10 activity.log.20130127.segae
-rw-rw—- 1 scmpadm scmpuser 50946829 Jan 29 07:13 activity.log.20130127.segaf
-rw-rw—- 1 scmpadm scmpuser 50968144 Jan 29 07:14 activity.log.20130127.segag
-rw-rw—- 1 scmpadm scmpuser 51758156 Jan 29 07:18 activity.log.20130127.segah
-rw-rw—- 1 scmpadm scmpuser 52290589 Jan 29 07:23 activity.log.20130127.segai
-rw-rw—- 1 scmpadm scmpuser 19329024 Jan 29 07:26 activity.log.20130127.segaj

Source: FULL ARTICLE at The UNIX and Linux Forums

Help for applying same actions to different directories with identical sub-directories

By A-V

Hello all

I have a situation and would be grateful if you will help me… I am not sure whether it is even possible

I have few folders/directories —e.g. A – B – C -in my MAIN directory
for each of them I would get the data from folder called DATA and go through a long list of actions which involves creating new sub-directories.
So e.g. will run a program for A -> creating 5 new sub-directories – doing some calculations and getting some results out
the same happens for B and C
I have tried to put an FOR loop around it which seems to work if I only have one of them there as the address for the directories will get confusing as my program refers to sub-directories in the A,B,C

Code:

###for A
FILES="A/*"
for X in $FILES
do
FILES="data/*"
for X in $FILES
.
.
.
done
##for B
FILES="B/*"
for X in $FILES
do
FILES="data/*"
for X in $FILES
.
.
.
done


Now my problem is how to adapt it so when I am on MAIN, I can run all of them at the same time and related directories would be created inside each of them separately …
the Path seems something like this

Code:

MAIN/A/ -> data, id, count, count/result
MAIN/B/ -> data, id, count, count/result
MAIN/C/ -> data, id, count, count/result


I am not sure whether something like this is possible … or they might be a very simple solution but my mind is not supporting now
Thank you in advance
Anna

Source: FULL ARTICLE at The UNIX and Linux Forums

Moving and renaming multiple files in a directory

By jimbojames

Hi.

I am trying to automate the movement and renaming of a number of files in a directory. I am using the ‘mv’ command as I do not have access to ‘rename’. I have the following scripted

Code:

FILES=$(ls /transfer/move/sys/mail/20130123/)
if [ ! -z "${FILES}" ] ; then
for i in ${FILES} ; do
mv /transfer/move/sys/mail/20130123/${FILES} /transfer/archive/sys/mail/20130123/MYFILENAME_`date +%Y%m%d%M%S00`.dat ; done
fi


which works perfectly when there is only one file in the directory, but when there are multiple files I get the following error

Quote:

Usage: mv [-I] [-i | -f] [-E{force|ignore|warn}] [–] src target
or: mv [-I] [-i | -f] [-E{force|ignore|warn}] [–] src1 … srcN directory
Usage: mv [-I] [-i | -f] [-E{force|ignore|warn}] [–] src target
or: mv [-I] [-i | -f] [-E{force|ignore|warn}] [–] src1 … srcN directory


.

I have attempted to add a sleep to the command, but the same error appears.

Can anyone advise what I am doing wrong, or even suggest a better way of achieving this?

Thanks in advance.

Source: FULL ARTICLE at The UNIX and Linux Forums

Capturing multiple values from user input

By jrymer

Hello,

I need to capture multiple values from user input and do not know how to do it. I’m writing a script to delete old files, but want to give the option to keep some by asking the user.

This is what my output looks like…

Code:

Old files to be deleted...
1 file1
2 file2


Then this bit of code is run after the above is output to keep or delete files.

Code:

echo "Would you like to keep any found files? (y/n)"
read USER_ANSWER

while [ ${USER_ANSWER} == "y" ]
do
echo "Type the number associated with the file(s) to be kept."
read USER_NUM
if [ $USER_NUM -gt ${#FILES[@]} -o $USER_NUM -le 0 ]
then
echo -e "Invalid."
else
echo -e "nKeeping: " ${FILEST[${USER_NUM}]}"n"
touch ${FILES[${USER_NUM}]}
echo -e "Removing "${FILES[@]}
break
fi
done
if [ ${USER_ANSWER} == "n" ]
then
echo -e "nDeleting "${FILES[@]}
rm -r ${FILES[@]}
fi


And from this point I prompt the user and ask which files they want to keep if any, and they select a number from the above output and it keeps that file. But I want to make it so the user can input more than one number for keeping the files, like typing 1 2 3 4 if they want to keep those four files.

How do I do this? I’m new to bash the more explanation contained in the answer the more I can learn 😀

Thanks

Source: FULL ARTICLE at The UNIX and Linux Forums