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 […]
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 […]
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]
Solaris 10 – Create an NFS Share The first step is to edit the /etc/dfs/dfstab file. [bash] share -F nfs -o rw=servername -d “share” /share [/bash] Start the server [bash] # /etc/init.d/nfs.server start [/bash]
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); […]
Blackberry Orange – APN Settings APN: orangeinternet Username for APN: [leave blank] Password for APN: [leave blank] To setup email, goto : http://www.blackberry.orange.co.uk/
Spreadsheet::WriteExcel – Carriage Return Issue Use “\n” though also set text wrap. [perl] my $format = $workbook->add_format(); $format->set_text_wrap() ; [/perl]
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 […]
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, […]
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 […]