Sponsored Content
Top Forums Shell Programming and Scripting How can I place a for statement.... Post 302223769 by bbbngowc on Monday 11th of August 2008 10:30:50 AM
Old 08-11-2008
Quote:
Originally Posted by zaxxon
Use an editor like vi, edit a file and insert your commands, use absolute paths as cron might get upset. Then edit the crontab with crontab -e and edit it accordingly. Your cron editor might be vi too.

This seemed to have worked:

#!/bin/ksh
for file in /dir/dir2/F*
do
gzip $file
done


I thought that the 'for' statement would've sent the script into a loop or something and wouldn't complete.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Where do I place ipchain scripts??

Where do I place IPCHAIN scripts on a Mandrake 8.0 computer?? (1 Reply)
Discussion started by: Deuce
1 Replies

2. UNIX for Dummies Questions & Answers

How to place restrictions in a directory

I have a directory called sync and the directory path is ftp/exports/sync. What I would like to do is place some documents in sync for external users to view and would like to have access restriction for the sync directory. i.e. login and password. How do I go about doing this in a Unix enviorment.... (3 Replies)
Discussion started by: coburn
3 Replies

3. Solaris

When does LK actually take place?

I appologize in advance, my question would be easly for me to research if I actually had a Solaris server that I had access to. And I am googled out. I am auditing a solaris 9.0 server's passwords (I was sent the passwd and shadow files) and need to know when the *LK*actually happens. In... (0 Replies)
Discussion started by: lerdahl
0 Replies

4. Shell Programming and Scripting

Getting the value of a line, that changes place

Hi I am trying to get the value of several results in a file called seq032.diag. The values I am looking for is down under Smooth Tracking nodes and is for g01r01 g02r01 s01t02 etc etc. The problem is that when I try to use look for text and tail etc, it works fine in one result file. In... (1 Reply)
Discussion started by: Navigatorchief
1 Replies

5. Shell Programming and Scripting

If statement - How to write a null statement

In my ksh script, if the conditions of a if statement are true, then do nothing; otherwise, execute some commands. How do I write the "do nothing" statement in the following example? Example: if (( "$x"="1" && "$y"="a" && "$z"="happy" )) then do nothing else command command fi... (3 Replies)
Discussion started by: april
3 Replies

6. Shell Programming and Scripting

How is use sselect statement o/p in insert statement.

Hi All, I am using Unix ksh script. I need to insert values to a table using the o/p from a slelect statement. Can anybody Help! My script looks like tihs. ---`sqlplus -s username/password@SID << EOF set heading off set feedback off set pages 0 insert into ${TB_NAME}_D... (2 Replies)
Discussion started by: nkosaraju
2 Replies

7. Shell Programming and Scripting

Place number with awk

Hello, if I've a list of number 23 34 56 78 how I can place a sequence of ordinated number in a boundary column so 1 23 2 34 3 56 4 78 Thanks in advance! (3 Replies)
Discussion started by: cv313x
3 Replies

8. Shell Programming and Scripting

usage of case statement in place of IF elif...

Hi, I need to carry out the back up of the data if exists...(file size not equal to zero) i tried in this way but it is not successful....where am making the mistakes? and if possible can i use case syntax in place of "if" #!/bin/ksh filename=`TZ=CST+24 date +%Y%m%d` ZERO=0... (3 Replies)
Discussion started by: aemunathan
3 Replies

9. Solaris

What is the best way to copy data from place to another place?

Dear Gurus, I need you to advice or suggestion about the best solution to copy data around 200-300G from serverA(location A) to serverB(location B). Normally, I will share folder and then copy but it takes too long time(about 2 days). Do you have any suggestion or which way should be... (9 Replies)
Discussion started by: unitipon
9 Replies

10. Shell Programming and Scripting

Convert Update statement into Insert statement in UNIX using awk, sed....

Hi folks, I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex. I have a bunch of update statements with all columns in a file which I need to convert into insert statements. UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
service(8)						      System Manager's Manual							service(8)

NAME
service - run a System V init script SYNOPSIS
service SCRIPT COMMAND [OPTIONS] service --status-all service --help | -h | --version DESCRIPTION
service runs a System V init script in as predictable an environment as possible, removing most environment variables and with the current working directory set to /. The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT. The supported values of COMMAND depend on the invoked script. service passes COMMAND and OPTIONS to the init script unmodified. All scripts should support at least the start and stop commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start com- mand. service --status-all runs all init scripts, in alphabetical order, with the status command. EXIT CODES
service calls the init script and returns the status returned by it. FILES
/etc/init.d The directory containing System V init scripts. ENVIRONMENT
LANG, TERM The only environment variables passed to the init scripts. SEE ALSO
/etc/init.d/skeleton, update-rc.d(8), init(8), invoke-rc.d(8). Jan 2006 service(8)
All times are GMT -4. The time now is 09:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy