Unix Shell - How to filter string for words that meet a certain criteria?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > September 2006 > How to filter string for words that meet a certain criteria?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to filter string for words that meet a certain criteria?
m.leyden@chello.nl

2006-09-24, 7:31 am

#!/bin/ksh

P_FILES=*.txt
P_REMOTEDIR=/home/klit
P_WORKINGDIR=/tmp
P_LOGFILE=sftp.log
P_FILELIST=sftp_remote_file_list.lis

echo "cd ${P_REMOTEDIR} " > ${P_WORKINGDIR}/${P_FILELIST}
echo "ls -1 ${P_FILES} " >>${P_WORKINGDIR}/${P_FILELIST}
echo "exit " >>${P_WORKINGDIR}/${P_FILELIST}

LS_OUTPUT=` sftp -b ${P_WORKINGDIR}/${P_FILELIST} klit@localhost `

echo ${LS_OUTPUT}


LS_OUTPUT value:
sftp> cd /home/klit sftp> ls -1 *.txt a.txt b.txt c.txt sftp> exit
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com