change only selected line


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers change only selected line
# 1  
Old 04-13-2006
change only selected line

hi

i dont know how to go abt this? as i m new to unix.
i have file say as xct. in file there are so many commands.
[ frankly its crontab file]. now here i m accepting new cron settings from user.

but these new settings will be applicable for particular command.
like my file is as
* * * * * read a < /aaadatamart/training/swapneel/util/cronsettings && [ $a -eq 1 ] && ksh /aaadatamart/training/swapneel/util
/hi

* * * * * read a < /aaadatamart/training/swapneel/util/cronsettings && [ $a -eq 2 ] && ksh /aaadatamart/training/swapneel/util
/hi1

* * * * * read a < /aaadatamart/training/swapneel/util/cronsettings && [ $a -eq 3 ] && ksh /aaadatamart/training/swapneel/util
/hi2


Now here first i will ask user choice -- [ say hi2]

then i will ask user abt new minute,date,... cron settings.
then those settings i want to add to this line so my crontab file with the new settings as per the user new input for selected choice [hi2]

plz guide me how go abt this. any logic or atleast any clue?

thanks in advance

regards,
swapneel


here i know how to edit cron file.
crontab < filename.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed to delete selected line from file

Ultimate goal is to delete lines from before and after a block of lines in a given file. First attempt was something like this: sed -e '1,/STARTUP/ d' inputfile.txt > outputfile.txt but that deleted everything down to and including the line with STARTUP. I need to delete everything before... (6 Replies)
Discussion started by: edstevens
6 Replies

2. Shell Programming and Scripting

change to one line for if then if then

if ! grep -q "aa" $line;then if ! grep -q "bb" $line;then somthing fi fi (2 Replies)
Discussion started by: yanglei_fage
2 Replies

3. Shell Programming and Scripting

Getting contents of line using a selected one as reference

How do you get the contents of a line directly after a selected one? Also, how about before it? I am using CSH and don't have any GNU products installed. Input file: apple orange plum So say I use grep on orange...how do I get plum (this line can be different so I can't just grep... (4 Replies)
Discussion started by: thibodc
4 Replies

4. UNIX Desktop Questions & Answers

change in line

i have a line that has ",,", i need to change it to "," ; But i have it more than one time in the same line , sub(",,",",",$0) just sub the first one in the line? ---------- Post updated at 08:15 AM ---------- Previous update was at 08:15 AM ---------- using AWK please (2 Replies)
Discussion started by: Reham.Donia
2 Replies

5. Shell Programming and Scripting

Compare selected columns of two files and print whole line with mismatch

hi! i researched about comparing two columns here and got an answer. but after examining my two files, i found out that the first columns of the two files are not unique with each other. all i want to compare is the 2nd and 3rd column. FILE 1: ABS 456 315 EBS 923 163 JYQ3 654 237 FILE 2:... (1 Reply)
Discussion started by: engr.jay
1 Replies

6. Shell Programming and Scripting

Delete a line between selected lines using sed or any other command

I want to delete a line between selected lines using sed: e.g. : Between "bus" to "pins", delete lines conaining "signal" word. Input : bus direction signal new signal old pins signal ok end Desired Output: bus direction pins signal end (4 Replies)
Discussion started by: nehashine
4 Replies

7. Shell Programming and Scripting

change line

Hello, I want to change a line at file whit a script i want to change line 150 for example, write hello and remove text of this line EXAMPLE LINE 150: my mother change to: LiNE 150: HELLO (4 Replies)
Discussion started by: uri_crack
4 Replies

8. Shell Programming and Scripting

trying to print selected fields of selected lines by AWK

I am trying to print 1st, 2nd, 13th and 14th fields of a file of line numbers from 29 to 10029. I dont know how to put this in one code. Currently I am removing the selected lines by awk 'NR==29,NR==10029' File1 > File2 and then doing awk '{print $1, $2, $13, $14}' File2 > File3 Can... (3 Replies)
Discussion started by: ananyob
3 Replies

9. Shell Programming and Scripting

SED: Place char at starting and replace selected line

Hello Experts, I am working on a small file editing script. Since all experts here are very generous to give me the complete code, I would take up the problem in steps so that I ensure my opportunity to learn. AIM: The script has some commented and some uncommented lines. I need to : ... (2 Replies)
Discussion started by: hkansal
2 Replies

10. Shell Programming and Scripting

Script to change file contents line by line

Hi, I'm struggling to write a script to do the following, -will go through each line in the file -in a specific character positions, changes the value to a new value -These character positions are fixed througout the file ----------------------- e.g.: file1.sh will have the following 3... (4 Replies)
Discussion started by: vini99
4 Replies
Login or Register to Ask a Question
yum-cron(8)															       yum-cron(8)

NAME
yum-cron - an interface to convieniently call yum from cron SYNOPSIS
yum-cron [config-file] DESCRIPTION
yum-cron is an alternate interface to yum that is optimised to be convenient to call from cron. It provides methods to keep repository metadata up to date, and to check for, download, and apply updates. Rather than accepting many different command line arguments, the dif- ferent functions of yum-cron can be accessed through config files. config-file is used to optionally specify the path to the configuration file to use. If it is not given, the default configuration file will be used. It is useful to be able to specify different configuration files for different use cases. For example, one configuration file might be set to update the repository metadata, and a line could be added to the crontab to run yum-cron frequently using this file. Then, another configuration file might be set to install updates, and yum-cron could be run from cron using this file just once each day. FILES
/etc/yum/yum-cron.conf /etc/yum/yum-cron-hourly.conf SEE ALSO
yum (8) AUTHORS
See the Authors file included with this program. BUGS
There of course aren't any bugs, but if you find any, you should email the mailing list, yum@lists.baseurl.org, or consult bugzilla. Nick Jacek yum-cron(8)