![]() |
|
|
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 |
| Multiple file processing - 1st line only to process - search/match substring | toneatlondon | Shell Programming and Scripting | 2 | 01-02-2008 09:20 PM |
| AWK Multi-Line Records Processing | RacerX | Shell Programming and Scripting | 10 | 10-18-2007 09:46 PM |
| processing a file with sed and awk | manouche | Shell Programming and Scripting | 4 | 10-11-2007 05:25 PM |
| Processing a CSV file | janemary.a | High Level Programming | 1 | 05-11-2007 07:27 AM |
| Have a shell script check for a file to exist before processing another file | heprox | Shell Programming and Scripting | 3 | 11-14-2006 03:26 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi
I amtrying to read the lines from a file, these lines are absolute paths in the system. I want to check if these paths exists, if they doesn't I want to create that path and put a file in that location/path. I had no trouble filtering these paths out using awk, grep, uniq etc but when it comes to write my own lite script that should process these lines I am clueless. I have been reading up awk but it seems a litle complicated, am I gooing in the right direction, what is the easiest way to solve this, what tools should I use? Thanks in advance. Cheers fable00 |
|
||||
|
I just tried this and it seems I have a lead now.
cat /etc/hosts | while q=$(line); do echo $q; done but feel free to give sugestions on how I should handle the logic with checking the if the file structure exists. Cheers fable00 |
|
||||
|
need help in almost a similar case
Hi ,
I am trying to write a script which picks up each entry ( list of Filesystems in a file ) from a file and then checks whether that Filesystem was backed up or not ? # Script to check for the backups of some particular Filesystems backup status cat <one f ile > while q=$(line) do echo $q > FS mminfo -c gbo472b -t yesterday | grep $FS if [ $? -eq 0 ] then echo "$FS was backed up " else echo "$FS was not backed up" fi done but it is not working ..pls let me know the problem. |
|
|||||
|
This script looks like it was written for sh/ksh/bash. If so, the syntax seems to be incorrect. Code:
#Script to check for the backups of some particular Filesystems backup status ######## cat <one f ile > # hashed this out. you don't need this while read line; do mminfo -c gbo472b -t yesterday | grep $line if [ $? -eq 0 ]; then echo "$FS was backed up " else echo "$FS was not backed up" fi done < /path/to/file/with/filesystem_list I have no idea what mminfo does, just fixed some syntax errors in the script. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|