scripting

Which script is better for automation of PTC Integrity application

时光毁灭记忆、已成空白 提交于 2019-12-13 04:45:49
问题 I want to create one script that will open the windows application and use that application to perform some task. I have listed out the activity that I want to automate below: Application is PTC integrity. It is linked with database server that has lot of files in it which have unique ID. So I need to use ID to open the document and export it. Steps: Open the application. Open the document using ID. Export the document to some specific format. I want to know which scripting to be used to

Bash Script to take the timestamp of a logged files and subtract it from the timestamp of another log file

假装没事ソ 提交于 2019-12-13 04:23:51
问题 I am trying to write a script that will have the following information: 4824597 11:26 /home/customer1/ITAM.xml . . . . 4824597 14:08 /home/customer46/ecds/dropoff/ITAM.xml I have another file that will log the same information 4824597 11:28 /home/customer1/ITAM.xml . . . . 4824597 14:11 /home/customer46/ecds/dropoff/ITAM.xml I want see how long it takes to receive files. To do this I want to subtract the timestamp of all the files logged in the log, and subtract them from their initial

Why is this lua script unable to open a Windows subdirectory?

半世苍凉 提交于 2019-12-13 04:13:46
问题 I'm trying to determine if one of several directories are present from within a lua script. It works on OSX, but not on Windows (linux is currently untested, but I expect that one to work). When the following code runs, I get an error: failed with this C:\Program Files (x86)\VideoLAN\VLC\lua\playlist\: No such file or directory I can confirm that that directory exists. I've escaped the slashes, I'm not sure what else could be the issue. local oses = { "/Applications/VLC.app/Contents/MacOS

rename file in bourne shell

跟風遠走 提交于 2019-12-13 04:09:10
问题 I am trying to write a bourne-shell script that takes a directory as a parameter and look for images named ixxx.a and rename them to ixxx_a.img where "xxx means the extension number for exemple image files would be named i001.a , i002.a ,i003.a ...) here what I tried mv $1/f[0-9][0-9][0-9].a $1/f[0-9][0-9][0-9]_a.img but it says that the DEST is not a directory. Any help would be much appreciated. Thanks. 回答1: for i in $1/f[0-9][0-9][0-9].a; do mv $i ${i%.a}_a.img done However, this does not

How to traverse path using variable in linux shells script

不羁岁月 提交于 2019-12-13 03:59:44
问题 I wrote a shell script to copy current date's files and place them in target folder with current date name, target folder path contains variable. This path works fine when i manually run the cd or cp command, but in shell script, while copying through cp, directory with variable is not recognized. d=`date +%b' '%d` td=`date +%d%b%Y` cd /filenet/shared/logs mkdir $td cd $td mkdir icn02 icn03 GC cpe01 cpe02 cpe03 cpeb01 cpeb02 icn01 css01 css02 http01 http02 http03 ssh hostname <<'ENDSSH' cd /

Reading specifed file line and creating new directories from words that have been taking of that file

时光怂恿深爱的人放手 提交于 2019-12-13 03:56:44
问题 for file in $* head -n 1 $file | while read folder do mkdir $directory $folder done Hello guys, I'm having problem with my script. What I want to do is: read first line from my specifed file and create new directories in my specifed directory from words that i have taken from that file. I'm getting errors like this: ./scriptas: line 2: syntax error near unexpected token `head' ./scriptas: line 2: `head -n 1 $file | while read folder' And my second question: how do I add a second variable from

add current/selected user to a group

↘锁芯ラ 提交于 2019-12-13 03:45:25
问题 can anyone tell me how can I (programatically) add the current/selected user to a group (like power user, backup opetarors) any function/info/code is welcomed 回答1: Well if all you want to do is add a user to a local group then you want the NetLocalGroupAddMembers API (to do it in C anyway). As a simple example: LOCALGROUP_MEMBERS_INFO_3 member[1]; // Add using fully qualified name, could also use SID with LOCALGROUP_MEMBERS_INFO_0 member[0].lgrmi3_domainandname = L"MAIN\\username"; status =

What is the best/easiest way to use nested switch/case statements?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 03:44:32
问题 What is the better practice of the following two switch/case statements? Is there an easier way (less code) to do this? switch (myValue) { case 1: { methodFor1(); break; } case 2: case 3: { methodFor2or3(); if (myValue == 2) methodFor2(); if (myValue == 3) methodFor3(); break; } } ...or... switch (myValue) { case 1: { methodFor1(); break; } case 2: case 3: { methodFor2or3(); switch (myValue) { case 2: { methodFor2(); break; } case 3: { methodFor3(); break; } } break; } } 回答1: switch (myValue)

copy folder to multiple servers with different %userprofile%

半世苍凉 提交于 2019-12-13 03:23:31
问题 I do not have access to GPO or AD/OU, so what I found to do the easiest was to create a batch file for users. Here is what I want to achieve : I have over 50 servers, and 10 users that will be connecting to these machines. On those different machines, I want to populate, from 1 location (1 main server, 1 main location/main user), all the internet favorites (C:\Users\MAIN USER\Favorites\Links) to everyone on every machine... I want to create a batch file, with minimum user manipulation, . So

Running AutoIt3 Scripts in VB 2010

岁酱吖の 提交于 2019-12-13 03:10:37
问题 I am fairly new to this, so pardon me if I am asking a silly question. I created an application in 2006 that calculates bottom-hole pressure. Basically, it takes the user-inputs, calls a secondary application called REFPROP, and delivers the REFPROP results back to my application to continue the calculations. Using AutoIt, I created a temp file with user inputs & another with REFPROP outputs. Since REFPROP was a cmd prompt application, the process was fairly simple. Now, the REFPROP I