![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| handling null values in files | ammu | Shell Programming and Scripting | 1 | 11-06-2007 04:43 PM |
| Handling null input... | DrRo183 | Shell Programming and Scripting | 2 | 04-11-2006 02:32 AM |
| Find files which contain a null character | Bab00shka | UNIX for Dummies Questions & Answers | 5 | 12-16-2005 10:41 AM |
| sending a null character to a terminal | vertigo23 | UNIX for Advanced & Expert Users | 3 | 09-30-2005 10:58 PM |
| Null handling in scripts | mohanprabu | Shell Programming and Scripting | 3 | 01-20-2005 04:50 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Null Character Handling
Hi All,
I have a problem with Null values while reading line by line from a text file. I wrote a shell script to read set of file names from a text file line by line, and zipping the each individual file and copying those zip files into some separate directory, and removing the original file from current directory. My shell script is as follows #!/usr/bin/ksh cat OCloader_gdlfiles/loaded_gdl_archive_file_list.txt | while read LINE do zip OCloader_archive/gdl_loaded/$LINE.zip OCloader_gdlfiles/$LINE rm OCloader_gdlfiles/$LINE done Note:- Here OCloader_gdlfiles is a soft link to some other directory in unix box. Now my problem was, Suppose while reading the lines from the text file, if any null input is assigned to the LINE variable then the rm command is as follows rm OCloader_gdlfiles/NULL then the corresponding soft link is removing from the unix box. To avoid this how should i change my code. I don't have any idea to do this. Your help will be appriciated. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|