Related
Eric Wilson I have several projects that need to change the version of Java/Grails/Maven. I'm trying to handle this with some scripts that can make changes. E.g: #!/bin/sh
export JAVA_HOME=/cygdrive/c/dev/Java/jdk1.5.0_22
export PATH=$JAVA_HOME/bin:$PATH
expo
Eric Wilson I have several projects that need to change the version of Java/Grails/Maven. I'm trying to handle this with some scripts that can make changes. E.g: #!/bin/sh
export JAVA_HOME=/cygdrive/c/dev/Java/jdk1.5.0_22
export PATH=$JAVA_HOME/bin:$PATH
expo
Eric Wilson I have several projects that need to change the version of Java/Grails/Maven. I'm trying to handle this with some scripts that can make changes. E.g: #!/bin/sh
export JAVA_HOME=/cygdrive/c/dev/Java/jdk1.5.0_22
export PATH=$JAVA_HOME/bin:$PATH
expo
David 542 To get the file cwdin python I can do the following: import os
cwd = os.getcwd()
filename = 'file.txt'
path = os.path.join(cwd, filename)
How would I do the same in a shell script? Fred Dantini The current working directory can be obtained in bash
David 542 To get the file cwdin python I can do the following: import os
cwd = os.getcwd()
filename = 'file.txt'
path = os.path.join(cwd, filename)
How would I do the same in a shell script? Fred Dantini The current working directory can be obtained in bash
Miton Shrivaca I wrote the following script to access SSH: #!/usr/bin/expect -f
spawn ssh 123456 -p 2222
expect "password:"
send "foopassword\r"
interact
#!/usr/bin/expect -fOnly works for me now because we have to automatically enter the password too. After
Adam In bash, we can retrieve the path of the current script through a $0variable , so if any script's dependent resources are in the same directory as the script directory, it can be used even if we are not executing the script in the script directory. How ca
Adam In bash, we can retrieve the path of the current script through a $0variable , so if any script's dependent resources are in the same directory as the script directory, it can be used even if we are not executing the script in the script directory. How ca
Bogaviev I am writing a script that requires to get a dynamic folder path like this. somefolder/prefix.datetime_suffix/foldera/folderb
The format of datetime is YYYYMMDDHHMMSS. The datetime part is changing. In the script I need to get the full path to folder
Adam In bash, we can retrieve the path of the current script through a $0variable , so if any script's dependent resources are in the same directory as the script directory, it can be used even if we are not executing the script in the script directory. How ca
Adam In bash, we can retrieve the path of the current script through a $0variable , so if any script's dependent resources are in the same directory as the script directory, it can be used even if we are not executing the script in the script directory. How ca
Bogaviev I am writing a script that requires to get a dynamic folder path like this. somefolder/prefix.datetime_suffix/foldera/folderb
The format of datetime is YYYYMMDDHHMMSS. The datetime part is changing. In the script I need to get the full path to folder
user 541686 when i run export PATH := mypath
$(error $(shell echo "$${PATH}"))
Nothing seems to PATHchange for my call shell. Why is this happening and how do I actually change the PATHfor shellcall? Florian Weimer Is this GNU make? There's a long-standing GN
user 541686 when i run export PATH := mypath
$(error $(shell echo "$${PATH}"))
Nothing seems to PATHchange for my call shell. Why is this happening and how do I actually change the PATHfor shellcall? Florian Weimer Is this GNU make? There's a long-standing GN
username In the default shell, the for loop given below for ((i=$llimit; i<=$ulimit; i++));
do
echo $i
done;
It will throw error "'((' is not expected" but when switching to bash shell for loop works fine Is there a way to change the shell in shellscript
h747 In my Bash script I have to change the name to a path address (new address) in a text file: (MYADDREES) to ( /home/run1/c1) and save it as a new file. I did this: define a new variable = new address and try to replace it with the previous address in the t
h747 In my Bash script I have to change the name to a path address (new address) in a text file: (MYADDREES) to ( /home/run1/c1) and save it as a new file. I did this: define a new variable = new address and try to replace it with the previous address in the t
tibia /home/temp.txt http://url_new_address.com
/home/list.txt URL http://url_address.com:URL1
URL http://url_address.com:URL2
URL http://url_address.com:URL3
How to replace line in temp.txt with URL2 in list.txt using shell script? after the command /home/l
Sujatha I am trying to change directory to home/developer. I have used cd home/developerin shell scripts . After executing the script, it went back to the original directory where I executed the shell script. Radu Rădeanu When you start the script, a new proce
Randy I have a Python script that finds files in relative directories. For example: Python scripts are located in /home/username/projectname/. I have a file which is called in a Python script in /home/username/projectname/subfolder. If I run the script from th
tibia /home/temp.txt http://url_new_address.com
/home/list.txt URL http://url_address.com:URL1
URL http://url_address.com:URL2
URL http://url_address.com:URL3
How to replace line in temp.txt with URL2 in list.txt using shell script? after the command /home/l
Sujatha I am trying to change directory to home/developer. I have used cd home/developerin shell scripts . After executing the script, it went back to the original directory where I executed the shell script. Radu Rădeanu When you start the script, a new proce
Paul Dirac I have a file with dates in the format YYYY-MM-DD. I want to write a shell script to change the date format to DD/MM/YYYY. This is my first attempt to no avail #!/bin/bash
NR=$(cat $1 | grep -o '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]' | cut -d'-
Randy I have a Python script that finds files in relative directories. For example: Python scripts are located in /home/username/projectname/. I have a file which is called in a Python script in /home/username/projectname/subfolder. If I run the script from th
Anand Mishra I want to add directory path containing multiple scripts for Windows and Linux in my build.gradle script. Currently, I'm defining a task like this and it works fine. task initdb(type: Exec){
if (System.getProperty('os.name').toLowerCase().cont
Anand Mishra I want to add directory path containing multiple scripts for Windows and Linux in my build.gradle script. Currently, I'm defining a task like this and it works fine. task initdb(type: Exec){
if (System.getProperty('os.name').toLowerCase().cont
Will Niles I'm using ZSH as my main shell, but in my server .zshrcI'd like to set up an ssh command with Expect to make it easier to ssh into my dev box when building flash (doesn't really need any Security, it's all on the intranet) of sorts). I can pass the
Justin Mayer From a Python-based install script running on Fish shell and supporting Python 2.7 and 3.4+, I would like to add the directory to an PATHenvironment variable if it doesn't already exist. After the script exits, it PATHshould contain the new direct
Justin Mayer From a Python based install script running on Fish shell and supporting Python 2.7 and 3.4+, I would like to add the directory to an PATHenvironment variable if it doesn't already exist. After the script exits, it PATHshould contain the new direct