terminal

.bash_profile and terminal

独自空忆成欢 提交于 2020-01-15 09:38:08
问题 my .bash_profile looks this way : When I open my terminal I get this three lines : -bash: export: Workbooks.app/Contents/SharedSupport/path-bin': not a valid identifier -bash: export: Workbooks.app/Contents/SharedSupport/path-bin': not a valid identifier -bash: export: Workbooks.app/Contents/SharedSupport/path-bin': not a valid identifier -bash: export: Workbooks.app/Contents/SharedSupport/path-bin': not a valid identifier What should I remove from my .bash_profile to get rid of this ? 回答1:

How to print $ in shell script?

回眸只為那壹抹淺笑 提交于 2020-01-15 07:19:07
问题 I want output as $msg1 two three. No space between $ and msg1. How it possible? #!/bin/sh msg1=$ ms="$msg1 msg1" msg2="$ms two" msg3="$msg2 three" echo $msg3 回答1: You can use: msg1='$' ms="${msg1}msg1" msg2="$ms two" msg3="$msg2 three" echo "$msg3" OUTPUT: $msg1 two three PS: Take note of ${msg1} syntax to create variable boundary around msg1 . This is used to avoid it making it $msg1msg1 回答2: Just quote the $ (or also the word around it). E.g. echo '$' echo 'some$inside' If you want a

Running JUnit tests in terminal

[亡魂溺海] 提交于 2020-01-15 06:39:09
问题 I'm new to running java from the terminal and am currently trying to run a JUnit test class in terminal. The basic structure of my java classes is JavaProject Queue.java QueueTests.java junit.jar RunTests RunTests is a script with the following code. #!/bin/sh javac Queue.java CLASSPATH=".:junit.jar:"; export CLASSPATH javac QueueTests.java java org.junit.runner.JUnitCore QueueTests However, when I run this, I always get a "Exception in thread "main" java.lang.NoClassDefFoundError" error from

Running JUnit tests in terminal

大城市里の小女人 提交于 2020-01-15 06:38:32
问题 I'm new to running java from the terminal and am currently trying to run a JUnit test class in terminal. The basic structure of my java classes is JavaProject Queue.java QueueTests.java junit.jar RunTests RunTests is a script with the following code. #!/bin/sh javac Queue.java CLASSPATH=".:junit.jar:"; export CLASSPATH javac QueueTests.java java org.junit.runner.JUnitCore QueueTests However, when I run this, I always get a "Exception in thread "main" java.lang.NoClassDefFoundError" error from

Shell Function string variables result blank after While loop and case?

北战南征 提交于 2020-01-15 04:39:48
问题 Why i not getting echo "User password is= $typo" result How i can get result of typo in the end after while loop. #!/bin/sh pass_mes() { read -sp 'Password: ' passvar echo $passvar } password_verify() { pass_ver=$(dscl /Search -authonly skull $typo 2>&1 | grep -i Authentication | awk '{print $1$5}') if [ "$pass_ver" == "Authenticationfailed." ]; then echo "Wrong_Password" else echo "Correct_Password" fi } funtion_cancle() { us_output=$(pass_mes) if [ "$us_output" == "User_Cancel" ]; then echo

Shell Function string variables result blank after While loop and case?

牧云@^-^@ 提交于 2020-01-15 04:39:47
问题 Why i not getting echo "User password is= $typo" result How i can get result of typo in the end after while loop. #!/bin/sh pass_mes() { read -sp 'Password: ' passvar echo $passvar } password_verify() { pass_ver=$(dscl /Search -authonly skull $typo 2>&1 | grep -i Authentication | awk '{print $1$5}') if [ "$pass_ver" == "Authenticationfailed." ]; then echo "Wrong_Password" else echo "Correct_Password" fi } funtion_cancle() { us_output=$(pass_mes) if [ "$us_output" == "User_Cancel" ]; then echo

Curses for python. Convert ansi color codes from stdin to curses output

岁酱吖の 提交于 2020-01-14 16:36:51
问题 I created decrypt.py two days ago. It's quite a funny program. It reads from stdin and prints the contents garbled to the screen using curses. However, when there are special characters like ansi color codes or tabs present in the input, they don't get displayed properly. Is there a good way to map these characters to the way curses handles tabs and colors on the terminal window? Your help is much appreciated. 回答1: This is a pretty niche function, so I'm not surprised there's been no answer.

Weird colored terminal response by git [duplicate]

懵懂的女人 提交于 2020-01-14 14:47:48
问题 This question already has an answer here : Atlassian “logo” after pushing to bitbucket (1 answer) Closed 4 years ago . Recently I was scared to death by the following colored terminal response. It was triggered by the git push command. Does anybody have a clue where this colored response comes from? 回答1: Just a guess, but perhaps the fine folks at Atlassian who run BitBucket are celebrating the Supreme Court ruling on gay marriage. That is their logo in rainbow-colored ASCII art... 来源: https:

Mikrotik auto user-manager user script needs improvement

谁都会走 提交于 2020-01-14 12:48:09
问题 I wrote this script but it's not working properly.Anyone can help? It's supposed to check download limit and download used by a user and then do some action i.e to remove the user from active ppp list but it has some flaws which is that I can't get the actual-profile value in a variable so instead I save the Profile name in Comment with the user manager user account so then I can get the profile name in the variable but that's not how I want it to be..So that's why how to get the actual

How to get the process id (PID) of an app launched using `open` command on OSX?

隐身守侯 提交于 2020-01-14 09:07:04
问题 I've launched an application via the open command on the OSX command line like so: open -a "/Applications/Adobe After Effects CC/Adobe After Effects CC.app" I want to get the process id of that launched application. Is there any way to do this reliably on OSX? It doesn't seem open returns anything, so I'm not sure I can even pipe its result into something like ps to perform a grep operation. I thought that maybe since the app is launched via the terminal I would know which app is the