Oct 3, 2002 #1 lutech Programmer Jan 25, 2002 16 CA Which command I can use to remove the first character from a string? Thanks in advance.
Oct 3, 2002 #2 vgersh99 Programmer Jul 27, 2000 2,146 US one of the ways: echo "string" | sed -e 's/^.\(.*\)/\1/g' vlad +---------------------------+ |#include<disclaimer.h> | +---------------------------+ Upvote 0 Downvote
one of the ways: echo "string" | sed -e 's/^.\(.*\)/\1/g' vlad +---------------------------+ |#include<disclaimer.h> | +---------------------------+
Oct 3, 2002 #3 vgersh99 Programmer Jul 27, 2000 2,146 US or in ksh [any POSIX compliant] echo "{myVar#?}" vlad +---------------------------+ |#include<disclaimer.h> | +---------------------------+ Upvote 0 Downvote
or in ksh [any POSIX compliant] echo "{myVar#?}" vlad +---------------------------+ |#include<disclaimer.h> | +---------------------------+
Oct 3, 2002 #5 CaKiwi Programmer Apr 8, 2001 1,294 US Or slightly simpler version of the sed solution echo "string" | sed 's/^.//' CaKiwi Upvote 0 Downvote
Oct 3, 2002 #6 Chapter11 Technical User Apr 15, 2002 791 US echo ${STRING} | cut -b 2- Upvote 0 Downvote