Help Me


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help Me
# 1  
Old 08-05-2014
Help Me

Hi,

I have a filename as below in the directory.
Code:
globi_abs_core_dev_p0103_20140303000000.zip

I want to extract 03 into a separate variable from the above file name.
Please help me in this regard as I am new to shell scripting

Last edited by rbatte1; 08-05-2014 at 12:58 PM.. Reason: Added CODE tags
# 2  
Old 08-05-2014
Is this a homework assignment? (Requests for help with homework assignments must be submitted in the Homework & Coursework Questions forum and must include a fully filled in template.)

Where do you have the filename? Is it in a shell variable? Is it in a file?

What shell and OS are you using?
# 3  
Old 08-05-2014
Welcome Omkarreddy,

It's not the best title really, as every thread is requesting help. Could we change it to something more suitable than "Help Me" please?

Additionally, please wrap code and data input/output in CODE tags, like this:-
Quote:
[CODE]This is my code[/CODE]
to produce the following (fixed character width, space respected):-
Code:
This is my code

Not only does it make posts far easier to read, but CODE and ICODE sections respect multiple space and have fixed width characters, which is important for easily seeing input/output requirements.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I have a few to questions in response first:-
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.

It would help us to know if there is a plan to run this in a loop of some sort and therefore lots of similar file names.


We're all here to learn and getting the relevant information will help us all.



Thanks, in advance,
Robin
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question