Skip to content

Instantly share code, notes, and snippets.

@jepio
Created May 9, 2014 17:40
Show Gist options
  • Save jepio/eb1718de04c3cfe05482 to your computer and use it in GitHub Desktop.
Save jepio/eb1718de04c3cfe05482 to your computer and use it in GitHub Desktop.
Print documents at GSI, pass printer number and filename. Needs a gsi host defined in ssh config.
#!/bin/bash
# copies a file to the gsi lx-pool,
# prints it and then removes it.
#
if [ "$#" -eq 2 ]; then
scp $2 gsi:$2
ssh gsi "pop -p$1 $2 2>&1 ; rm $2" > /tmp/log
cat /tmp/log && rm /tmp/log
else
echo "Use with 2 parameters: printer number (no p) and file name."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment