scripting

Can't find package from application written in Tcl

社会主义新天地 提交于 2020-05-17 06:22:06
问题 Thanks to the comments, better understand the problem a bit. The variables: thufir@dur:~/tcl/packages$ thufir@dur:~/tcl/packages$ echo 'puts $auto_path' | tclsh /usr/share/tcltk/tcl8.6 /usr/share/tcltk /usr/lib /usr/local/lib/tcltk /usr/local/share/tcltk /usr/lib/tcltk/x86_64-linux-gnu /usr/lib/tcltk /usr/lib/tcltk/tcl8.6 thufir@dur:~/tcl/packages$ thufir@dur:~/tcl/packages$ echo 'puts $tcl_pkgPath' | tclsh /usr/local/lib/tcltk /usr/local/share/tcltk /usr/lib/tcltk/x86_64-linux-gnu /usr/lib

Making Cocoa Application Scriptable Swift

梦想与她 提交于 2020-05-10 18:52:22
问题 Goal I am trying to make my Cocoa Application that has been written in Swift scriptable from Applescript. What I've Done I have created a SDEF file, configured my info.plist and created a class which I think is appropriate. definition.sdef <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd"> <dictionary title="SamX"> <!-- specific suite(s) for the application follow... --> <suite name="SamX Scripting Suite" code="Samx" description

Making Cocoa Application Scriptable Swift

▼魔方 西西 提交于 2020-05-10 18:46:15
问题 Goal I am trying to make my Cocoa Application that has been written in Swift scriptable from Applescript. What I've Done I have created a SDEF file, configured my info.plist and created a class which I think is appropriate. definition.sdef <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd"> <dictionary title="SamX"> <!-- specific suite(s) for the application follow... --> <suite name="SamX Scripting Suite" code="Samx" description

Inline if shell script

纵然是瞬间 提交于 2020-05-09 20:08:59
问题 Is it possible to execute shell script in command line like this : counter=`ps -ef | grep -c "myApplication"`; if [ $counter -eq 1 ] then; echo "true"; > Above example is not working I get only > character not the result I'm trying to get, that is "true" When I execute ps -ef | grep -c "myApplication I get 1 output. Is it possible to create result from single line in a script ? thank you 回答1: It doesn't work because you missed out fi to end your if statement. counter=`ps -ef | grep -c

Inline if shell script

社会主义新天地 提交于 2020-05-09 20:08:38
问题 Is it possible to execute shell script in command line like this : counter=`ps -ef | grep -c "myApplication"`; if [ $counter -eq 1 ] then; echo "true"; > Above example is not working I get only > character not the result I'm trying to get, that is "true" When I execute ps -ef | grep -c "myApplication I get 1 output. Is it possible to create result from single line in a script ? thank you 回答1: It doesn't work because you missed out fi to end your if statement. counter=`ps -ef | grep -c

Inline if shell script

戏子无情 提交于 2020-05-09 20:07:20
问题 Is it possible to execute shell script in command line like this : counter=`ps -ef | grep -c "myApplication"`; if [ $counter -eq 1 ] then; echo "true"; > Above example is not working I get only > character not the result I'm trying to get, that is "true" When I execute ps -ef | grep -c "myApplication I get 1 output. Is it possible to create result from single line in a script ? thank you 回答1: It doesn't work because you missed out fi to end your if statement. counter=`ps -ef | grep -c

Merge all lines that are identical aside from a key field and make key field a range [closed]

那年仲夏 提交于 2020-05-09 17:24:04
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last month . I've been looking at a lot of posts and haven't quite found what I'm looking for. I'm not sure how to go about taking the following sample data: host1 input nic1 ip1 ip2 PROT 30000 10 host1 input nic1 ip1 ip2 PROT 40000 10 host1 input nic1 ip1 ip2 PROT 50000 10 host1 input nic1 ip1

SQL Query that Create CSV file with Timestamp on it

一笑奈何 提交于 2020-04-18 06:14:09
问题 I created This shell script below, which fetches data from MySQL and create output as csv file. but I want to create this csv with a timestamp. so I just want filename to be like this result_ddmmyy.csv Is there any way to do this from script or from SQL query. #!/usr/bin/bash #scirpt to connect with db master_db_user='root' master_db_passwd='123' master_db_port='3306' master_db_host='localhost' master_db_name='sagar_tb' #Preparing script #MySql Command to connect to a database mysql -u$master

Awk parsing multiple gz files

半腔热情 提交于 2020-04-18 04:43:00
问题 I am new to shell scripting and trying to grep some text in multiple gz files using awk. My code zcat log*.gz | awk{awk logic goes here} but the above takes a lot of time to sift through prod logs.Is there any way to make it run faster? 回答1: You might see some output faster if you loop over the files instead of uncompressing them all at once: for log in log*.gz; do zcat "$log" | awk 'awk logic goes here' done 回答2: I wrote a script called zawk which can do this natively. It's similar to glenn

Awk parsing multiple gz files

↘锁芯ラ 提交于 2020-04-18 04:40:13
问题 I am new to shell scripting and trying to grep some text in multiple gz files using awk. My code zcat log*.gz | awk{awk logic goes here} but the above takes a lot of time to sift through prod logs.Is there any way to make it run faster? 回答1: You might see some output faster if you loop over the files instead of uncompressing them all at once: for log in log*.gz; do zcat "$log" | awk 'awk logic goes here' done 回答2: I wrote a script called zawk which can do this natively. It's similar to glenn