![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hidden control characters in a Unix Text File! | kewl_guy | Shell Programming and Scripting | 6 | 1 Week Ago 10:09 AM |
| Control character in a file | cursive | UNIX for Dummies Questions & Answers | 5 | 04-25-2007 10:40 PM |
| Control saving file by type | saswerks | UNIX for Dummies Questions & Answers | 4 | 02-15-2005 12:47 PM |
| how can I create a dos file in sco unix? | fresh | SCO | 2 | 03-29-2004 08:09 AM |
| unix process control | nicko | Filesystems, Disks and Memory | 2 | 05-16-2002 04:39 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
UNIX gurus:
Following is what I am trying to do: I need to create a control file for another file that I am creating. The information needed in the control file is the date in YYYYMMDD format and then the number of records in the other file right justified and lpadded with spaces of 20. So say I have a file a.dat and it has 200 records. I need to create a control file a.ctl having the following data. 20060605 200 I can only use UNIX commands as I am not allowed to use any scripts. I know date +'%Y%m%d' will give me the date in YYYYMMDD format and wc -l <filename> would give me record count but how would I go about piping the output of the above to one control file? |
| Forum Sponsor | ||
|
|
|
|||
|
Brilliant!! Thanks man it works!!
Im using ksh. i had tried a combination of cut, wc -l and date...but couldnt get it to work like u have. Could you explaina little bit more of what the above is really doing. I am not able to figure out what the %s20s\n is doing? |
|
|||
|
Quote:
Thanks everyone. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|