I am new to Shell Script programming. I am attempting to make a program that outputs only gives back the odd arguments. For example, "I am a robot" should give "I a" only.
I thought I could use the shift command to through the arguments along with while and if statements, but I am unsure of how to convey a division by 2 with a remainder of 1 in the square brackets in the if statement ([])
#!/bin/sh
X=$1
shift
while [ $# -gt 0 ]; do
if [ "HELP HERE" ]; then
X=$1
echo $X
fi
shift
done
echo $X