Sponsored Content
Top Forums Shell Programming and Scripting Change the Windows Batch script to UNIX shell script. Post 302346565 by tomailraj on Sunday 23rd of August 2009 04:31:18 AM
Old 08-23-2009
MySQL Change the Windows Batch script to UNIX shell script.

Hi,
When I run the below script in UNIX it's throwing syntax errors. Actually it's a windows batch script. Could anyone change the below Windows Batch script to UNIX shell script...

Script:

REM :: File Name : Refresh_OTL.bat
REM :: Parameters : %1 - Region
REM :: : %2 - Cube Type
REM :: :
REM :: Notes :

REM ============================== set ENVIRONMENT VARIABLES ==========================================
set Region=%1
set CubeType=%2
set CommonPath=\export\home\essbase\OTL_REFRESH
FOR /f "eol=; tokens=1,2,3,4,5 delims=, " %%a IN (%CommonPath%\CubeList_%Region%.txt) DO (
if /i %%b EQU %CubeType% (
SET Server=%%a
SET CubeType=%%b
SET Application=%%d
SET _Application=%%c
SET Database=%%e
))

set OTLUnLockLog=%CommonPath%\Logs\%OTL_Application%_UnLock_Object.log

REM ==================================================================================================== =
essmsh Unlock_Objects.bat %Server% %OTL_Application% %Application% %Database% %OTLUnLockLog%
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to convert unix .ksh script to windows .batch script

I am using awk in my .ksh script but when I am trying to run in windows its not recognising awk part of the ksh script , even when I changed it to gawk it does not work, this is how my .ksh and .bat files look like. thanx. #!/bin/ksh egrep -v "Rpt 038|PM$|Parameters:|Begin |Date: |End... (1 Reply)
Discussion started by: 2.5lt V8
1 Replies

2. Shell Programming and Scripting

FTP from unix shell script to windows

Hi, I m trying to connect/establish FTP from unix shell script to my PC.Below the script i have written #!/bin/ksh ftp -v -n ddcappip01.com << "EOF" user Amit jason bye EOF ------------------------------ERROR-------------------------- but i m getting the below error for the... (4 Replies)
Discussion started by: ali560045
4 Replies

3. UNIX for Advanced & Expert Users

Executing a shell script from windows;script present in unix

I need to execute a shell script kept in unix machine from windows. User id, password area available. For eg. There's a shell script wich moves all the logs kept in my home directory to a directory named LOGS. Now i need to get this done through windows; either using a batch file, or java... (4 Replies)
Discussion started by: rajneesh_kapoor
4 Replies

4. Windows & DOS: Issues & Discussions

Gawk Script in Windows batch file - Help

Good morning all. I have been running into a problem running a simple gawk script that selects every third line from an input file and writes it to an output file. gawk "NR%3==0" FileIn > FileOut I am attempting to run this command from a batch file at the command line. I have several hundred... (6 Replies)
Discussion started by: 10000springs
6 Replies

5. Shell Programming and Scripting

FTP from windows to unix server using unix shell script

Hi, Is it possible to ftp a huge zip file from windows to unix server using unix shell scripting? If so what command i need to use. thanks in advance. (1 Reply)
Discussion started by: Shri123
1 Replies

6. Shell Programming and Scripting

Dos batch script to execute unix shell script

Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh. Thanks in advance (2 Replies)
Discussion started by: Shri123
2 Replies

7. Shell Programming and Scripting

Windows Batch script for Unix commands

I wish to create a folder on a unix server B from my windows box using windows batch script. Below is my windows batch script. @ ECHO OFF ::Enter your Directory name: echo Enter your Directory name: set /p mydir= plink user1@ServerA mkdir %mydir% At plink command i get logged... (7 Replies)
Discussion started by: mohtashims
7 Replies

8. Shell Programming and Scripting

To run a shell script in remote server from windows batch file

Hi all, i need to run a shell script on remote server. I have created file .bat file in windows server with following code, c:\Users\Desktop\putty.exe -ssh -pw password user@server ./script.sh i need to run the script.sh in my remote server Above command is not working, any... (4 Replies)
Discussion started by: rammm
4 Replies

9. Shell Programming and Scripting

Windows batch script to Shell script

Hi everyone, I've below windows batch script which is used to filter the file contents line by line and assign the matched values to the variables in for loop. for /F "tokens=1,3 delims=:" %%A in (%LOG_DIR%\PM_IS_workflow_status.log) do ( set "ATTR_NAME=%%A" if /i "!ATTR_NAME!" EQU "Folder"... (1 Reply)
Discussion started by: Kathraji
1 Replies

10. Shell Programming and Scripting

Batch script to execute shell script in UNIX server

Hi team, My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server. I have completed the first part i.e From windows to using to unix server with the help of psftp.exe code: psftp user@host -pw password <... (1 Reply)
Discussion started by: bhupeshchavan
1 Replies
SET 
ROLE(7) SQL Commands SET ROLE(7) NAME
SET ROLE - set the current user identifier of the current session SYNOPSIS
SET [ SESSION | LOCAL ] ROLE rolename SET [ SESSION | LOCAL ] ROLE NONE RESET ROLE DESCRIPTION
This command sets the current user identifier of the current SQL session to be rolename. The role name can be written as either an identi- fier or a string literal. After SET ROLE, permissions checking for SQL commands is carried out as though the named role were the one that had logged in originally. The specified rolename must be a role that the current session user is a member of. (If the session user is a superuser, any role can be selected.) The SESSION and LOCAL modifiers act the same as for the regular SET [set(7)] command. The NONE and RESET forms reset the current user identifier to be the current session user identifier. These forms can be executed by any user. NOTES
Using this command, it is possible to either add privileges or restrict one's privileges. If the session user role has the INHERITS attribute, then it automatically has all the privileges of every role that it could SET ROLE to; in this case SET ROLE effectively drops all the privileges assigned directly to the session user and to the other roles it is a member of, leaving only the privileges available to the named role. On the other hand, if the session user role has the NOINHERITS attribute, SET ROLE drops the privileges assigned directly to the session user and instead acquires the privileges available to the named role. In particular, when a superuser chooses to SET ROLE to a non-superuser role, she loses her superuser privileges. SET ROLE has effects comparable to SET SESSION AUTHORIZATION [set_session_authorization(7)], but the privilege checks involved are quite different. Also, SET SESSION AUTHORIZATION determines which roles are allowable for later SET ROLE commands, whereas changing roles with SET ROLE does not change the set of roles allowed to a later SET ROLE. SET ROLE does not process session variables as specified by the role's ALTER ROLE [alter_role(7)] settings; this only happens during login. SET ROLE cannot be used within a SECURITY DEFINER function. EXAMPLES
SELECT SESSION_USER, CURRENT_USER; session_user | current_user --------------+-------------- peter | peter SET ROLE 'paul'; SELECT SESSION_USER, CURRENT_USER; session_user | current_user --------------+-------------- peter | paul COMPATIBILITY
PostgreSQL allows identifier syntax ("rolename"), while the SQL standard requires the role name to be written as a string literal. SQL does not allow this command during a transaction; PostgreSQL does not make this restriction because there is no reason to. The SESSION and LOCAL modifiers are a PostgreSQL extension, as is the RESET syntax. SEE ALSO
SET SESSION AUTHORIZATION [set_session_authorization(7)] SQL - Language Statements 2010-05-14 SET ROLE(7)
All times are GMT -4. The time now is 07:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy