Hi Im trying to extract the first seven characters of everyline of a file, then set those seven characters as a variable.
The text file is generated by:
who >> who.txt
A line of text looks like:
Username pts/## otherdata
So Im trying to get the usernames which on my system are always...
Ill give it a try at work tonight. I really appreciate it.
Itd be running on Solaris 10.
I cant remember what version Im running of the top of my head.
Thanks for the pointers. I didnt realize how vague I had been.
* Is the # in front of style0002 also a digit ?
No. I overlooked that when I picked # to represent variables
* Are there other style0002 occurrences not enclosed in styleURL tags ?
Yes.
* Are there other style0002...
Hi Im trying to replace text in a file based upon a pattern.
The pattern Im looking for is:
<styleURL>#style0002</styleURL>
<name>#######6105#######</name>
The # are seven alphanumeric characters before and after 6105.
I need it to replace that with:
<styleURL>#style0003</styleURL>...
Hi Im wondering how to extract data from a variable, maybe using SED or AWK. I have a variable that contains YYYYMMDD, something like var=20091013. Can I extract the year, YYYY, to varY, the month, MM, to varM and the day, DD to varD?
Hi. Im wondering if there is a way to use flags when starting a script.
Something like this.
Script -a -b 10
Right now Ive got something like this.
while getopts ab AA
do case $AA in
a) var="value"
;;
esac
done
So with that code I can only use flags ( -a -b...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.