scripting

Checking file names in a directory with entries in an excel spreadsheet; What am I doing wrong?

天大地大妈咪最大 提交于 2021-02-11 17:58:45
问题 I'm attempting to write a PowerShell script (my first ever, so be gentle) to go through all the file names in a directory and check if they exist in an excel spreadsheet that I have. If a file name does exist in both, I want to move/copy that file to a new directory. Right now it runs with no errors, but nothing actually happens. So far I have: #open excel sheet $objexcel=new-object -com excel.application $workbook=$objexcel.workbooks.open("<spreadsheet location>") #use Sheet2 $worksheet =

How to exclude some files from the loop in shell script [duplicate]

人走茶凉 提交于 2021-02-11 15:37:54
问题 This question already has answers here : for-loop for every folder in a directory, excluding some of them (5 answers) Closed 12 months ago . #! /bin/sh for file in $Files/*.txt; do chmod 777 $file done It will give permission 777 to all .txt files but I've 7 other .txt file for which I don't want to give 777 permission. How can I do that? 回答1: you can add a conditional check as below. As there's no clear attribute differentiating the files you want to exclude, you'd need to specifically check

bash for loop to check if directory exists

时光总嘲笑我的痴心妄想 提交于 2021-02-11 13:47:42
问题 The following program is just for fun, I am trying to get into bash scripting. I am not going to use the script for doing backups. I am trying to create a for loop to check if user input (directories that will be backed up) in an array are valid. If input is valid, it should be used. If not, it should be overwritten with a default value /home/$USER . echo "Please enter absolute path of directory for backup. Default is "/home/$USER echo "You can choose multiple directories. Press CTRL-D to

Photoshop Script - Change specific text layer contents

允我心安 提交于 2021-02-11 13:32:18
问题 I have a photoshop script file which opens up a template psd file: var fileRef = new File("z:\psd.psd") var docRef = app.open (fileRef) Once this is open, i would like code which changes the text of a specific layer called "LAYER1" to "TEST". I have researched and carried out numerous tests but i am having issues and errors with undefined variables. 回答1: It it will be necessary to loop over all layers, (including layers within Layer Groups ), to find your specific named Text Layer (e.g.

Hide and show html table columns

[亡魂溺海] 提交于 2021-02-11 13:21:40
问题 can anyone help to solve this html/javaScript issue; iam tying to implement a solution to hide/show columns in my html table that has a header with multi-rows, when i start hiding the columns from the right it works fine, but when i start from the left, i can see the issue; some cells get hidden even if not needed to be, this is my code thatnks: $(function() { // on init $('.hide-column').eq(0).trigger( "click" ); // on click $('.hide-column').click(HideColumns) function HideColumns() { var

Hide and show html table columns

前提是你 提交于 2021-02-11 13:21:34
问题 can anyone help to solve this html/javaScript issue; iam tying to implement a solution to hide/show columns in my html table that has a header with multi-rows, when i start hiding the columns from the right it works fine, but when i start from the left, i can see the issue; some cells get hidden even if not needed to be, this is my code thatnks: $(function() { // on init $('.hide-column').eq(0).trigger( "click" ); // on click $('.hide-column').click(HideColumns) function HideColumns() { var

Why would one run cat|bash before copying/pasting into a terminal?

。_饼干妹妹 提交于 2021-02-11 12:22:28
问题 I've seen someone running cat|bash before pasting commands from the clipboard into a terminal. bash executes commands in bash I do not know why do we need cat here and |(pipe) . What useful effects does this practice have? 回答1: It was my colleague who executed a bunch of command in the terminal, [...] he did cat|bash before pasting those set of commands He likely this to stop Bash from interpreting anything in the commands as editing input, to override any special keybindings and aliases he's

List Jenkins job build detials for last one year along with the user who triggered the build

寵の児 提交于 2021-02-11 06:51:05
问题 Is there any simple way to work with APIs or with scripting to get list of all builds performed on all jobs for last one year along with the user who triggered the build as a report? 回答1: This should do. Run from <JENKINS_URL>/script or in a Jenkins job with an " Execute System Groovy Script " (not an "Execute Groovy script"). Updated: to include details from the subject line. def jobNamePattern ='.*' // adjust to folder/job regex as needed def daysBack = 365 // adjust to how many days back

Login on password prompt in linux through perl script

萝らか妹 提交于 2021-02-10 05:49:09
问题 I want to pass a password through a Perl script. I am basically writing a script to execute commands on Linux terminal. At a particular commands execution, I get a prompt for Password :← (I need to enter password here through my script) But, my script just stops working. After browsing, I found Expect but I get an error saying: Can't locate Expect.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) I have not used Expect before so have no clue what do I need to install. 回答1: Expect.pm

Array to string in TCL

妖精的绣舞 提交于 2021-02-08 11:48:19
问题 How can I convert a known array in to string in TCL? an array might have values such as root_user_appversion 10.1.3.20 and/or I just want to take out the last values out of it which 10.1.3.20 . 回答1: You can transform the array in list: set my_list [array get my_array] puts "last element: [lindex $my_list [expr {[llength $my_list] -1}] ]" After that, you can easily convert your list in string with join : set my_string [join $my_list " "] 回答2: I think you want join [dict values [array get the