Sponsored Content
Top Forums Shell Programming and Scripting Changing script from csh to bash Post 302850591 by disedorgue on Thursday 5th of September 2013 05:46:16 AM
Old 09-05-2013
Hello,
Something as:
Code:
if [ $fsw -gt 0 ]; then
for swath in $(awk 'BEGIN {for (i='$fsw';i<='$lsw';i++) printf ("%s\n", i) }')
do

## work to be done

done
fi

Regards.
This User Gave Thanks to disedorgue For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting bash script to csh

Hi, I'm a beginner in scripting and I recently wrote a bash script that would've worked fine until I realized it needed to be written in csh. Could someone please show me how to correctly change the syntax from bash to csh in this script? Any help will be greatly appreciated. I can provide more... (4 Replies)
Discussion started by: Kweekwom
4 Replies

2. Shell Programming and Scripting

how to make your bash script run on a machine with csh and bash

hi, i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies

3. Shell Programming and Scripting

Bash script: issue changing directories in script

I am working on a script that checks two arguments at the command line. The first argument is a search pattern, the second can be a file or a directory, if it is a file a second script is called that checks it for the search pattern. If the second argument is a directory, it checks for the search... (5 Replies)
Discussion started by: Breakology
5 Replies

4. Shell Programming and Scripting

changing cron using bash script

How can I change the cron entries only for ABC and XYZ from dosomething_1.0.sh to nowchanged_2.0 using a bash script ? Any help will be appreciated. # # ABC 00,05,10,15,20,25,30,35,40,45,50,55 * * * * /mydir/dosomething_1.0.sh 1>/dev/null 2>&1 # # ## # DEF... (4 Replies)
Discussion started by: jville
4 Replies

5. Shell Programming and Scripting

translate a short csh script to bash

Hi, I have a csh: set NODES = `cat $HOST_FILE` set NODELIST = $TMPDIR/namd2.nodelist echo group main >! $NODELIST foreach node ( $NODES ) echo host $node >> $NODELIST end @ NUMPROCS = 2 * $#NODES I am very frustrated to translate it to bash: NODES = `cat... (3 Replies)
Discussion started by: rockytodd
3 Replies

6. Shell Programming and Scripting

How to run a bash script in csh shell?

Hi how to execute a bash script in csh shell? Thanks (3 Replies)
Discussion started by: rubinovito
3 Replies

7. Shell Programming and Scripting

Need a script to convert csh to bash

Hi, Can anyone give me a script to convert csh to bash? or any key points which can help me to do so as i am new to it. (3 Replies)
Discussion started by: vineet.dhingra
3 Replies

8. Ubuntu

error LD: undefined variable while changing shell from bash to csh

Hi, i am a beginner in ubuntu. my default shell is bash. everytime i try to change the shell with command "csh", i get a message (probably an error message). after i get into c-shell, when i try to execute a c shellscript, then it showed the same message. any idea about what is this about or any... (1 Reply)
Discussion started by: Avinash Nayak
1 Replies

9. Shell Programming and Scripting

Converting awk script from bash to csh

I have the following script set up and working properly in bash. It basically copies a set of lines which match "AS1100002" from one file and replaces the same lines in another file. awk -vN=AS1100002* 'NR==FNR { if($1 ~ N)K=$0; next } { if($1 in K) $0=K; print }' $datadir/file1... (7 Replies)
Discussion started by: ncwxpanther
7 Replies

10. Shell Programming and Scripting

Changing date using bash script

I am trying to change dates in a bash script. I have a start time and an endtime and want to increment the times. Basically the month and day have to be incremented in a loop to create two strings, stm and etm defining the start and end times. stm="2014-05-13T00:00:00"... (4 Replies)
Discussion started by: novilatte
4 Replies
BEGIN(7)                                                           SQL Commands                                                           BEGIN(7)

NAME
BEGIN - start a transaction block SYNOPSIS
BEGIN [ WORK | TRANSACTION ] [ transaction_mode [, ...] ] where transaction_mode is one of: ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED } READ WRITE | READ ONLY DESCRIPTION
BEGIN initiates a transaction block, that is, all statements after a BEGIN command will be executed in a single transaction until an explicit COMMIT [commit(7)] or ROLLBACK [rollback(7)] is given. By default (without BEGIN), PostgreSQL executes transactions in ``autocom- mit'' mode, that is, each statement is executed in its own transaction and a commit is implicitly performed at the end of the statement (if execution was successful, otherwise a rollback is done). Statements are executed more quickly in a transaction block, because transaction start/commit requires significant CPU and disk activity. Execution of multiple statements inside a transaction is also useful to ensure consistency when making several related changes: other ses- sions will be unable to see the intermediate states wherein not all the related updates have been done. If the isolation level or read/write mode is specified, the new transaction has those characteristics, as if SET TRANSACTION [set_transac- tion(7)] was executed. PARAMETERS
WORK TRANSACTION Optional key words. They have no effect. Refer to SET TRANSACTION [set_transaction(7)] for information on the meaning of the other parameters to this statement. NOTES
START TRANSACTION [start_transaction(7)] has the same functionality as BEGIN. Use COMMIT [commit(7)] or ROLLBACK [rollback(7)] to terminate a transaction block. Issuing BEGIN when already inside a transaction block will provoke a warning message. The state of the transaction is not affected. To nest transactions within a transaction block, use savepoints (see SAVEPOINT [savepoint(7)]). For reasons of backwards compatibility, the commas between successive transaction_modes can be omitted. EXAMPLES
To begin a transaction block: BEGIN; COMPATIBILITY
BEGIN is a PostgreSQL language extension. It is equivalent to the SQL-standard command START TRANSACTION [start_transaction(7)], whose ref- erence page contains additional compatibility information. Incidentally, the BEGIN key word is used for a different purpose in embedded SQL. You are advised to be careful about the transaction semantics when porting database applications. SEE ALSO
COMMIT [commit(7)], ROLLBACK [rollback(7)], START TRANSACTION [start_transaction(7)], SAVEPOINT [savepoint(7)] SQL - Language Statements 2010-05-14 BEGIN(7)
All times are GMT -4. The time now is 11:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy