Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

unix, vi editor, copy and paste, not pasting first lines

Writer Emily Wong

I am performing the below steps. Looks like I am not able to copy and paste into vi editor on unix with #!/bin/ksh as the first line. I pasted the code I need in but I do not see that in first line in vi editor. I have tried right clicking to copy and paste and also shirt+insert.

  1. Open a session in Putty and login using credentials

  2. Type and enter “vi .profile” (this opens a text editor within Putty)

  3. Copy and paste (shirt+insert) the following text into the profile (“#!/bin/ksh” must be the first line)

    #!/bin/ksh
    set -o vi
    ## Command line aliases ##
    alias x="xterm -ls -sb&"
    alias p="ps -fu $LOGNAME"
    alias j="jobs"
    alias sasdir="cd /gfs_sastmp/sastmp049"
    alias w="find /gfs_sastmp/sastmp049 -type f -user $LOGNAME 2>/dev/null -exec ls -lrt {} \;"
    alias myprof="vi ~/.profile"
    alias resync=". $HOME/.profile"
    alias myenv="vi ~/sas_unix.sas"
    alias s="find ./ -type f 2>/dev/null -exec ls -lrt {} \;|grep -i"
    alias u="du -lag"
    alias mdr1="/gfs_bin/sas/update_pwd/setpass_rc.ksh $LOGNAME@LDAP DWPRD"
    alias mdr2="/gfs_bin/sas/update_pwd/setpass_sm.ksh $LOGNAME@LDAP DWPRD"
    alias unarch="/gfs_bin/sas/compression/uncompress.bsh"

1 Answer

You have to set vi to insert mode; otherwise the first letter that does so will mark the start of the insert. Either put vi in insert mode before doing the paste, or start the copied text with i, o, or some other insert mode command.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy