10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello everyone,
I need help comparing 2 arrays. the first array is static; the second array is not ..
array1=( "macOS Mojave" "iTunes" )
cd /Volumes
array2=( * )
# output of array2
macOS Mojave
iTunes
Mac me
The problem occurs when I compare the arrays with the following code -
... (6 Replies)
Discussion started by: trexthurman
6 Replies
2. Shell Programming and Scripting
I found the following issue by simply increasing a variable. The ((A++)) expression returns an error, the other expressions both return 0. Does anyone know why?
script.sh:
#! /bin/bash
A=0
B=0
C=0
((A++)) ; echo "${?}"
((B=B+1)) ; echo "${?}"
((C+=1))... (8 Replies)
Discussion started by: elbrand
8 Replies
3. Shell Programming and Scripting
Hi,
I have the following code which is giving error mentioned below. Please can you support on this. Also suggest how can we access all the items against single vasservicename in circlename array,i.e, vasservicename say MTSTV will be available to all circles which are mentioned in the array... (2 Replies)
Discussion started by: siramitsharma
2 Replies
4. Shell Programming and Scripting
Hello,
I'm attempting to run a script on a remote server via SSH but am having issues getting the script to run using proprietary binaries located on the remote server as it keeps complaining that commands are invalid on the local machine. If I run the script locally on the remote server, it... (2 Replies)
Discussion started by: shadyuk
2 Replies
5. Shell Programming and Scripting
ls -l /md01/EL/MarketData/inbound/ststr/INVENTORY* |tail -5 |awk '{ print $5,$6,$7,$8,$9 }'If I run the above from the command line the output to md_email is formatted correctly as
78213497 May 1 12:50 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120430.PINESTREET.CSV.done
77904740 May 2... (3 Replies)
Discussion started by: smenago
3 Replies
6. Shell Programming and Scripting
I'm running mysql in a bash script
mysql <<EOF
query
EOF
one query is like this:
UPDATE $dbname.$prefix"config" SET value = $var WHERE "$prefix"config.name = 'table colname';
with variable
but it's giving an error
i'm not sure what to put for
"$prefix"config.name
the table... (3 Replies)
Discussion started by: vanessafan99
3 Replies
7. Shell Programming and Scripting
Hi,
I am trying to write a PBS shell script that launches a bash process. The issue is that the bash process needs a variable in it and the shell script is interpreting the variable. How do I pass this as a literal string? Here is my code snippit:
TMP=".fasta"
FILEOUT=$FILE$TMP
cd... (2 Replies)
Discussion started by: bioBob
2 Replies
8. Shell Programming and Scripting
I use the following shell script in bash and it works fine. It returns 1
# cat /etc/httpd/conf/res.txt
maldet(24444): {scan} scan completed on eicar_com.zip: files 1, malware hits 1, cleaned hits 0
# if ]; then echo 0 > /etc/httpd/conf/malflag; else echo 1 > /etc/httpd/conf/malflag;... (2 Replies)
Discussion started by: anilcliff
2 Replies
9. Shell Programming and Scripting
Hi guys,
I need for the bash code below a little bit help: cat script.sh
#!/bin/bash
5_MYVALUE="test"
echo "$5_MYVALUE"
If I try to run the script, got follow failure:
./script.sh
./script.sh: line 4: 5_MYVALUE=test: command not found
_MYVALUE
My questions are how... (4 Replies)
Discussion started by: research3
4 Replies
10. Shell Programming and Scripting
Hi all,
I'm not sure but I guess, that is a bash version issue.
The script working fine on "GNU bash, version 3.2.25(1)-release Ubuntu".
#!/bin/bash
while IFS=">" read a id val
do
if ]
then
VAL=${id%<*}; ID=${id#*</}
echo $VAL
echo $ID
sed... (5 Replies)
Discussion started by: research3
5 Replies