10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a text file (say, declarevars.txt) that contains multiple lines that are essentially meant to be variable declarations:
set arr1 = (var1a var1b var1c)
set arr2 = (var2a var2b var2c)
.
.
.
I want to be able to read this text file within a csh (sorry) script and have that... (2 Replies)
Discussion started by: arjaydj
2 Replies
2. Shell Programming and Scripting
From the command line:
dions-air:scripts dion$ ls -l /Users/dion/Library/Application\ Support/Garmin/Devices/3816821036/History/2014-06-07-055251.TCX
-rw-r--r-- 1 dion staff 157934 7 Jun 06:55 /Users/dion/Library/Application Support/Garmin/Devices/3816821036/History/2014-06-07-055251.TCXworks... (2 Replies)
Discussion started by: dionbl
2 Replies
3. Shell Programming and Scripting
I have a input file like this.
Sample.txt
30 | TXDatacenter | TXBackupDC
10 | UKDatacenter | UKBackupDC
0 | NLDatacenter | NLBackupDC
......
......
......
I need to get these values in different variables like this.
Load1=30
PriCenter1=TXDatacenter... (5 Replies)
Discussion started by: Visha
5 Replies
4. Shell Programming and Scripting
Recently i made a script for a project at molecular dynamics but am stuck at the last step.The thing i want to do is to ask the user to input the number of particles, then replace the bolded numbers at lines 9 and 17..
code
#!/bin/bash
#read number of particles
echo "insert the number of... (2 Replies)
Discussion started by: arisinhell
2 Replies
5. UNIX for Advanced & Expert Users
Hi all guys,
how you can read in thread title, I'm deploying a bash script in which I have to export some variables inside it.
But (I think you know) the export command works only inside the script and so, on exit command, the variables aren't set like I set inside the script.
Consequently in... (8 Replies)
Discussion started by: idro
8 Replies
6. Shell Programming and Scripting
Hello, I am new to the whole "scripting" thing. Below is the script that I have so far and where i need the Variables to go (VAR#)
#!/bin/bash
#Sample Script
VAR1=
echo "Choose an option: 1) Create a file. 2) Delete a file. 3) Move a file."
read VAR1
case $VAR1 in
1)
echo "Pick... (4 Replies)
Discussion started by: eclerget
4 Replies
7. Shell Programming and Scripting
I am using variable to give the location of the file I am using but I get error.
Here is the code:
LogFile=/tmp/log.email
echo -e "could not close the service - error number $error \n" > $LogFile
well this is not all the code but is enough because the problem start when I try to use the... (3 Replies)
Discussion started by: programAngel
3 Replies
8. Shell Programming and Scripting
This is what I have:
#!/bin/bash
#ascript.sh
WORD1=`tail -n +$1 /home/gscn/word1.txt | head -1`
sed -e "s/WORD1/$WORD1/g" < /home/gscn/configtmp > /home/gscn/config
WORD2=`tail -n +$1 /home/gscn/word2.txt | head -1`
sed -e "s/WORD2/$WORD2/g" < /home/gscn/config2tmp >... (4 Replies)
Discussion started by: guitarscn
4 Replies
9. Shell Programming and Scripting
I have one line files with 17 records separated by a semi-colon. I need to create a variable from each record, which I can do via a separate awk for each one, but I know there has to be a better way. Along with pulling out the variable, I need to convert some url coding like a + to a space, etc.... (4 Replies)
Discussion started by: numele
4 Replies
10. Shell Programming and Scripting
Hey guys, new problem....im not being able to seperate variables.
the code runs like this...
OPTIONS=$(awk '{print $2}' /etc/fstab}
a=$(zenity --list --text "Mount points selection" --radiolist --column "choice" --column "mountpt" FALSE $OPTIONS); echo $a
Note: the result i get is that... (2 Replies)
Discussion started by: dplate07
2 Replies