cd

cd(1) and variables with spaces (cygwin)

人走茶凉 提交于 2019-12-23 15:54:19
问题 I've been having quite an unusual problem. In my .bashrc file, I have set a variable to a path name with spaces in it. I had a feeling this would cause problems, but I played around with setting an alias in a similar way and got it to work like so: alias npp="\"/cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe\"" Now, I thought I could use the same trick for my environment variable - export PRO="\"/cygdrive/c/Program Files (x86)\"" This worked. Kind of. [myName] $ echo $PRO "/cygdrive/c

How to follow a shortcut in powershell

[亡魂溺海] 提交于 2019-12-22 18:12:40
问题 In powershell, you use cd dir to go into the directory dir . But if dir is a shortcut to a directory, cd dir and cd dir.lnk both give an error, saying that the directory doesn't exist. So how do I follow that shortcut? (In Linux cd dir just works . In Windows, I've got no idea) 回答1: Using the shell com-object, you can get the target path and from there, do what you wish. Get-ShortcutTargetPath function Get-ShortcutTargetPath($fileName) { $sh = New-Object -COM WScript.Shell $targetPath = $sh

Creating multi-platform CDs for software distribution

爱⌒轻易说出口 提交于 2019-12-21 06:08:24
问题 This is not strictly programming related, but I hope still relevant. I'm working on a project which is written in Java and intended for use on PCs and Macs. It will be distributed on CD (and perhaps DVD, eventually). Our intended audience is decidedly non-technical and, as such, it's important the CD "just work" when it's loaded. This is not itself difficult. For Windows, we can setup Autorun to automatically launch the app and, for Mac, we can use special folder formatting to make it clear

How to implement your own cd command in your own shell [duplicate]

房东的猫 提交于 2019-12-20 15:31:06
问题 This question already has answers here : Why doesn't the cd command work in my shell program? (3 answers) Closed 15 days ago . I am working in a mini project: "MY OWN COMMAND INTERPRETER (SHELL)", like the Bash shell or Sh shell. Till now it can execute every predefined commands like ls, ps, pwd, date. Except this I have implemented some other operations like Input Redirection(<), output redirection(>), PIPE (|) features. Along with this i have implemented my own user-commands like pid, ppid,

bash - how to pipe result from the which command to cd

为君一笑 提交于 2019-12-20 07:59:07
问题 How could I pipe the result from a which command to cd ? This is what I am trying to do: which oracle | cd cd < which oracle But none of them works. Is there a way to achieve this (rather than copy/paste of course)? Edit : on second thought, this command would fail, because the destination file is NOT a folder/directory . So I am thinking and working out a better way to get rid of the trailing "/oracle" part now (sed or awk, or even Perl) :) Edit : Okay that's what I've got in the end: cd

Inno Setup - Prompt to user to insert the next setup disk/CD/DVD

做~自己de王妃 提交于 2019-12-13 12:50:41
问题 I am currently working on a setup package for a rather large program (over 5Gb) that I have to distribute via CDs or DVDs. My problem is that I never had to do such a thing and I don't know how to do so. I know that I have to enable DiskSpanning to allow the package to be divided in severals BINs and use DiskSliceSize to ensure that the slices can be burnt on CDs/DVDs. But how do I make the package prompt the user to insert the next CD? Thank you in advance and have a nice day! 回答1: Inno

Changing the current directory in Java to implement “cd” command in linux [closed]

守給你的承諾、 提交于 2019-12-13 10:08:13
问题 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 5 years ago . I'm trying to build a command line interpreter that implements "cd" command in linux. I don't know how the function that suppose to do that shoud work. I know that this question has already been answered here: Changing the current working directory in Java? But I'm new to Java and

How do you invoke a terminal through a command and cd to a directory?

南楼画角 提交于 2019-12-12 06:10:46
问题 I'm trying to invoke a terminal from the command line and cd into a particular directory on my MAC machine. I understand that this can be done using this command on Linux. gnome-terminal --working-directory="/path/to/new/directory" Is there an equivalent in Mac without actually writing an AppleScript? I know this command opens a new terminal though. open -a Terminal.app All I need to figure out is a way to add an argument to cd into another directory from the new terminal. Any help is much

bash - change directory inside a script wont work

丶灬走出姿态 提交于 2019-12-12 05:11:54
问题 Try to find a solution for a problem but stucked with the following : I have a path of a folder (I got full path and partial path). Im tying to cd to that folder, but it keep saying "No such file or directory". Thats the partial code : for var in "$@" ; do if [[ -d $var ]] ; then if [ "$(ls -A $var)" ]; then cd $var Would appericiate any help :) Thanks 回答1: I think this line is your problem: if [ "$(ls -A $var)" ]; then Why do you need this test at all? Your previous check looks for the

Create an empty CD-ROM image and inject/extract files into/from it using Java

£可爱£侵袭症+ 提交于 2019-12-12 04:19:07
问题 Using Java I need to be able to create an empty CD image and also to inject/extract files into/from this image. Do you know any java libs for that? Is there a way to accomplish it without using JNI? ( if not , then your JNI solution is appreciated). Thank you guys. PS. This task is required for data transportation between emulated environment created by Qemu emulator. 回答1: In principle this is simple to implement, just write a file that is properly structured as CD-image. In practice thats