tilde-expansion Questions

7

Solved

Possible Duplicate: How do I find a user's home directory in Perl? I'm running Ubuntu. Whenever I pass a Perl script a path that starts with ~ (e.g. ~/Documents/file.txt) it fails fi...
Weakness asked 28/10, 2010 at 14:19

19

Solved

I have a variable in my bash script whose value is something like this: ~/a/b/c Note that it is unexpanded tilde. When I do ls -lt on this variable (call it $VAR), I get no such directory. I wan...
Beedon asked 18/10, 2010 at 21:54

6

Solved

I need to check whether a file in a user's home directory exists so use file check: if ( -e "~/foo.txt" ) { print "yes, it exists!" ; } Even though there is a file called foo.txt under the user...
Waterborne asked 25/9, 2009 at 3:59

5

Solved

Say I have a folder called Foo located in /home/user/ (my /home/user also being represented by ~). I want to have a variable a="~/Foo" and then do cd $a I get -bash: cd: ~/Foo: No such file o...
Banas asked 21/4, 2011 at 18:25

3

Solved

I have to open some file for writing, and its name contains the tilde sign (~). The following code fails to create the desired text file. If I replace the ~ with /home/oren then everything wo...
Se asked 9/9, 2019 at 10:49

3

Solved

The tilde expression is not working on my RStudio! I am using a windows 10 OS. Update : After looking more carefully(thanks to Dason) It seems the "~" is pointing to "user/Documents/" rather then...
Pole asked 21/12, 2015 at 17:6

4

Solved

How can I expand a path String with a tilde in Swift? I have a string like "~/Desktop" and I'd like to use this path with the NSFileManager methods, which requires the tilde to be expanded to "/Use...
Gwynethgwynne asked 3/7, 2016 at 18:23

1

Solved

My module.modulemap file looks like this: module CompanyInternalSDK { header "~/Company/CompanyInternalSDK.framework/Headers/CompanyInternalSDK.h" export * } However, I get this error: /Users...

1

I have a Dockerfile with the following line: COPY *.zip ~user1 The user user1 already exists and has a home directory (i.e. /home/user1). The goal, of course, is to copy the zip file into that u...
Vexillum asked 29/1, 2017 at 23:43

1

Solved

I want to check whether or not the hidden .git folder exists. First thought was to use: if [ -d "~/.git" ]; then echo "Do stuff" fi But the -d apparently does not look for hidden folders....
Peignoir asked 26/1, 2017 at 10:38

3

Solved

Is there any reason to use the variable $HOME instead of a simple ~ (tilde) in a shell script?

1

Solved

I tried to get the Android Studio launcher (studio.sh) to use my manually installed Java (not the system-wide default Java). Since I already declared PATH and JAVA_HOME in my .bashrc file, I simply...
Bield asked 28/8, 2015 at 17:45

6

Assume someuser has a home directory /home/someuser NAME=someuser In bash - what expression to I use combining tilde (~) and $NAME to return the users home directory? HOMEDIRECTORY=~someuser ech...
Physoclistous asked 15/1, 2010 at 4:12

1

Solved

I am writing a simple bash script and wanted to display all the items in a a particular directory. I tried doing the following: desktop="~/Desktop/testr/" echo $desktop echo `ls $desktop` Howeve...
Butcher asked 31/5, 2013 at 17:27

1

Solved

I'm new in shell programming on macosx and have a little problem. I've written the following shell script: #!/bin/sh function createlink { source_file=$1 target_file="~/$source_file" if [[ -f $...
Dyslexia asked 18/5, 2013 at 9:50

2

Solved

In my .sh file, I have this, cp $file $SOME_PATH, while $SOME_PATH is exported as export SOME_PATH="~/path/to/path/". But when I ran this .sh file, I got error message saying like no such...
Ultrafilter asked 21/10, 2010 at 3:30

4

I've tried the following short example to find out about a bug in a bigger program I am working on. It looks like QFile doesn't support unix (or the shell's) notation for the home directory: #incl...
Petras asked 12/5, 2010 at 6:40

1

Solved

In Objective-C, how do I go about converting tilde-based pathnames to full pathnames? That is, I'd like to convert from ~/sandbox to /Users/TheBobs/sandbox.
Esemplastic asked 4/11, 2009 at 18:51
1

© 2022 - 2024 — McMap. All rights reserved.