UNIX

Shell, KSH Read Variables

Shell, KSH Read Variables Read in a Variable From a user we read with: read var. Then the users can type something in. One should first print something like: [bash] print -n “Enter your favorite haircolor: “; read var; print “”. [/bash] The -n suppresses the newline sign. Read into a File Line for Line […]

Perl

Pass Parameters to Perl Script

Pass Parameters to Perl Script Perl command line arguments stored in the special array called @ARGV. ARGV example Use $ARGV[n] to display argument. Use $#ARGV to get total number of passed argument to a perl script. For example, if your scriptname is foo.pl and you called script as follows: ./foo.pl one two three You can […]

UNIX

change passwd – permission denied (NIS)

Change passwd – permission denied (NIS) I setup a new NIS server and put the NIS source files in /var/yp/src/ The command line “passwd” gave me a permission denied when changing an NIS user’s password. A restart of yp fixed the problem for me.. Eventually I restarted NIS with: [bash] /usr/lib/netsvc/yp/ypstop /usr/lib/netsvc/yp/ypstart [/bash]

Perl

Perl Split

Perl Split A very useful function in Perl is split, which splits up a string and places it into an array. The function uses a regular expression and as usual works on the $_ variable unless otherwise specified. The split function is used like this: [perl] $info = “Caine:Michael:Actor:14, Leafy Drive”; @personal = split(/:/, $info); […]

Perl

Perl Hashes – HowTo

Perl Hash Howto This how-to comes with no guaratees other than the fact that these code segments were copy/pasted from code that I wrote and ran successfully. Initialize (clear, or empty) a hash Assigning an empty list is the fastest method. Solution my %hash = (); Initialize (clear, or empty) a hash reference People have […]

UNIX

SCCS Commands

SCCS Commands sccs Subcommands Checking Files In and Out The following subcommands are useful when retrieving versions or checking in changes. Checking Out a File for Editing: sccs edit 1 To edit a source file, you must check it out first using sccs edit. SCCS responds with the delta ID of the version just retrieved, […]

Security UNIX

Setting up SSH public/private keys

Setting up SSH public/private keys SSH (Secure Shell) can be set up with public/private key pairs so that you don’t have to type the password each time. Because SSH is the transport for other services such as SCP (secure copy), SFTP (secure file transfer), and other services (CVS, etc), this can be very convenient and […]