Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to compare strings in zsh script

#!/bin/sh

argn=$#
i=0

for arg do
   shift
   i=$(( i + 1 ))

   if [ "$i" -lt "$argn" ]; then
       set -- "$@" ssh -t "$arg"
   else
       set -- "$@" "/pathtofile/$arg/log.log"
   fi
done

command "$@"
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #compare #strings #zsh #script
ADD COMMENT
Topic
Name
3+6 =