Sponsored Content
Top Forums Shell Programming and Scripting Windows script to shell script Post 303015071 by shefali1908 on Tuesday 27th of March 2018 08:29:25 AM
Old 03-27-2018
Hi rovf ,

Thanks for your reply
My basic concern was to rewrite this command in linux shell script
IF "%EnvName%"=="DEV" (
echo This is Dev
for /f "tokens=2 delims=^=" %%l in ('findstr "Server_%EnvName%" "%~dp0%configFilePath%"') do (
)

This is what i tried writing
if [$EnvName:==:"DEV"]; then
echo This is DEV environment
for -f "tokens=2 delims=^= A in ('findstr "Server_$EnvName" "$path$configFilePath"')";do
set serv=!serv!$A
echo "Server Name !serv!"
done
fi

but I am getting syntax error near unexpected token `"tokens=2 delims=^= A in ('findstr "Server_$EnvName" "$path$configFilePath"')"'
main.sh: line 43: `for -f "tokens=2 delims=^= A in ('findstr "Server_$EnvName" "$path$configFilePath"')";do '

Can you please sugegest
very new in Linux
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to execute a shell script from Windows

I like to start a korn job remotely, from windows. I tried REXEC and that is not what I want. Need help !!!! thanks (4 Replies)
Discussion started by: kyawlin
4 Replies

2. UNIX for Advanced & Expert Users

Executing shell script from Windows FTP

Hello, Any inputs on the possibility of executing a shell script on unix box from Windows FTP TIA (1 Reply)
Discussion started by: B2BIntegrator
1 Replies

3. Shell Programming and Scripting

Renaming putty windows with a shell script

i frequently have to open multiple putty windows to ssh into a unix server running HP-UX 11.23. Since i use some of the windows for dedicated processes i would like to rename them (the caption displayed in the titlebar) to something more convenient than the standard <Host>.<Server>.com While... (4 Replies)
Discussion started by: orno
4 Replies

4. 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

5. UNIX for Dummies Questions & Answers

Shell script in windows

I use windows and I wanted to know how I can use shell script in windows. I saw windows power shell but the commands they use seem to be different from those I know as a newbie. For example I wanted to change the permission of a file using chmod, but it doesn't recognise such a command. So I would... (12 Replies)
Discussion started by: #moveon
12 Replies

6. Shell Programming and Scripting

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 ::... (5 Replies)
Discussion started by: tomailraj
5 Replies

7. UNIX for Advanced & Expert Users

ftp in shell script from linux to windows XP

Hi, I have 9 different linux based servers and i am automating there healthcheckup by doing ssh and fetching deviations out of it in a single text file. I am doing so by using ssh keygen. I am done with the above part . Now i want to ftp that text file to my windows XP desktop and i want to... (4 Replies)
Discussion started by: gemnian.g
4 Replies

8. Shell Programming and Scripting

Unix shell script to Copy files from one Windows server to another Windows server.

Can anybody please help me on how to code for the below requirement: I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Discussion started by: SravsJaya
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

C Shell script not run with Windows 10

Hi all, I have a script has been writing for Unix or Linux. Now I want to run under Windows 10. is give me Error: if:Badly formed number How to fix this please help *** This is a copy of a part of Script. set absolute_gap = 0 if ($min_p_to_p != "" && $min_p_to_p != "N/A" && $min_p_to_t... (5 Replies)
Discussion started by: dovo
5 Replies
afs5log(8)						   System Administrator's Manual						afs5log(8)

NAME
afs5log - AFS token initializer SYNOPSIS
afs5log [ [-v] [-5] [-k] [-p path] [cell[=principal] ] ] [...] DESCRIPTION
The afs5log command uses Kerberos to obtain AFS tokens for the named cells. If no cell is named, tokens are obtained for the local cell. If the principal name of the afs service for the cell is known, the cell name may also be given in the form cell=principal_name. Attempts are made to obtain Kerberos IV credentials first, and if that fails, afs5log will create Kerberos 5 (2b-style) tokens. ARGUMENTS
-v Turns on verbose mode. afs5log will print debugging messages while it does its work. Use more than once to get more detail. -p path Determine which cell the specified path resides in, and obtain tokens for that cell. -s strategy Overrides the default token-setting strategy ("v4,524,2b,rxk5") with the named strategy. Recognized strategy names include: rxk5 rxk5 (requires OpenAFS 1.6 or later) 2b rxkad "2b" (requires OpenAFS 1.2.8 or later) -5 Skip attempts to use Kerberos IV and just use 2b-style tokens, which are only supported by OpenAFS 1.2.8 and later. -k Skip attempts to use Kerberos IV and use rxk5-style tokens, which are only supported by OpenAFS 1.6 and later. -n Assume that, if a cell name and a realm name differ only by case, that the name of the AFS service's principal name doesn't include an instance. SEE ALSO
pam_krb5(5) krb5.conf(5) BUGS
Probably, but let's hope not. If you find any, please file them in the bug database at http://bugzilla.redhat.com/ against the "pam_krb5" component. AUTHOR
Nalin Dahyabhai <nalin@redhat.com> openSUSE 2007/12/18 afs5log(8)
All times are GMT -4. The time now is 05:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy