A little guidance needed :)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting A little guidance needed :)
# 8  
Old 03-07-2008
position=1
word="command"
#put the following in a loop
#cut -c stands for column
while [ $position -le 8 ]
do
echo `echo $word |cut -c$position`
position=`expr $position + 1`
done
# 9  
Old 03-07-2008
if you are learning bash, you will go here and learn about strings in bash..
eg
Code:
# a="command"
#  echo "length of a is ${#a} "
length of a is 7

to get individual fields, i leave it to you. its all in that document.
# 10  
Old 03-07-2008
Hey ghostdog, many thanks for that - certainly cleared up some loose ends. Yeah I'm fairly new to bash scripting however I've been forced into doing some and although the earlier sections were suprisingly easy, the later have taken a huge leap in difficulty and i find myself getting stuck quite a bit.

Has gotten me a bit worried that even though I'm not going to be utilising bash/shell scripting very often (I've been taught and learn Java & .net mainly) i have to be assessed on it.

I'm sort of working over time here to build as much of a foundation as possible but things look grim.

Thank you very much though, for the guidance - its much appreciated.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

New to AIX. Need Guidance

Hi There, I am new to AIX. I am eager to learn the AIX System administration or if there is any other prerequisite before this. Please can anyone help me or guide how to start with AIX, what all courses and certifications do I need to do. I have basic knowledge of UNIX. Please guide as I am... (3 Replies)
Discussion started by: rahulat302
3 Replies

2. Shell Programming and Scripting

Need Some guidance on scripting

Hey All, I am newbie on scripting and need some guidance from all the experts here. I am working on one project where I will check the status/health of around ten (10) solaris 10 servers. I have one central server from where I have already setup the passwordless SFTP and setup the cron... (1 Reply)
Discussion started by: supercops
1 Replies

3. UNIX for Dummies Questions & Answers

Just need some guidance on this nawk

Hi, I am trying to debug some KSH script and it has the nawk portion below. I just want to confirm whether I understand what it does correctly. Example usage of the nawk line is run as below: nawk '/^#/ {next} $1~/^'testp.cfg'$|^'testp.cfg'\.testdb\.com\.ph$/ { c=0 while... (1 Reply)
Discussion started by: newbie_01
1 Replies

4. AIX

Need guidance on VMStat

I need some guidance on the differences in observations, not sure how significantly different are they. Also, It would be nice to hear on the values and what the obvious tuning for performance missing. Observation 1 ending vmstat -v 3948544 memory pages ending vmstat -v ... (1 Reply)
Discussion started by: Snipper
1 Replies

5. Shell Programming and Scripting

Guidance needed for a typical shell script with sql query

Hi , I have a txt file with contents like: 1234 2345 3456 7891 I need to write a script which takes input file as txt file..run a sql query for that number and place the output of query in another file.. select * from bus_event where acct_nbr='1234'( from input txt file) the query... (20 Replies)
Discussion started by: Rajesh Putnala
20 Replies

6. UNIX for Dummies Questions & Answers

Need guidance on RHEL patch

Hi, I am new with updates in RHEL especially servers. The question is: 1. Do I need to register to RHEL in order for me to use the up2date? 2. For updates in RHEL need to use up2date, but what is the thing that I need to do before the patches? I mean what should I backup in case my patches... (0 Replies)
Discussion started by: flekzout
0 Replies

7. HP-UX

HP-UX 10.20 fbackup? restore help/guidance needed

Hello, We've recently had a multiple hardrive failure in our legacy HP9000. Now the drives are repaired and the filesystems are recreated, I went to restore the last of the database tables from our dds3 backup, but cannot. Here's what's going on: BTW, I'm an absolute novice w/ HP-UX The... (5 Replies)
Discussion started by: jastuart
5 Replies

8. UNIX for Advanced & Expert Users

Guidance needed for quick script

Hi all, I am trying to get the exception count daily from a log file which is more than 1 GB in size. I am using loops which get the count of the exception and transaction. But i need to take this exception count for a time frame from 5.00 am to 5:00 pm. I Think I can use to exact the... (4 Replies)
Discussion started by: senthilkumar_ak
4 Replies

9. What is on Your Mind?

Career Guidance

Hi, I am a newbie to Unix, I was introduced to UNIX 8 months back during my Training, I was attracted to Unix as they give complete freedom. I would like to ask how can a OS Admin can go into development field of Unix. Currently I am working in a MNC in Backup- Storage Admin Domain I am... (1 Reply)
Discussion started by: sufi_431
1 Replies

10. AIX

NIM Guidance

I've just started to explore NIM and I'm looking for additional information on how to set it up and configure it. I've read through the "NIM A-Z" and have many unanswered questions. One question is how can I have the NIM server pull a mksysb of the clients and can I schedule this to happen... (1 Reply)
Discussion started by: scottsl
1 Replies
Login or Register to Ask a Question