10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I pass an argument to bash as run. The first command in green executes as expected, however the second in blue fails as the $run does not expand. I tried to escape the variable with \ thinking the quotes were making the literal translation and also "${run}" but both did not work to expand the... (3 Replies)
Discussion started by: cmccabe
3 Replies
2. Shell Programming and Scripting
I would like to search and print a match of the user entered $ARGV.
Im terrible with hashes and really dont know where to go from here.
The example data file
name location phone
Bugs holeintheground 5551212
Woody holeinthetree 6661313
Jerry holeinthewall 7771414... (4 Replies)
Discussion started by: sumguy
4 Replies
3. Shell Programming and Scripting
Hello,
Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file
i.e I am workiing on a script which will run through crontab and the script will
chekout the code ,zip and copy to the... (3 Replies)
Discussion started by: rohit22hamirpur
3 Replies
4. Shell Programming and Scripting
Hi everybody!
I am writing a script which accepts two arguments one of them being a message. All is working except for the message part. That is, to accept text as an argument.
I have trouble storing and echoing a line of text. It seems that writing a few words and store them in an... (6 Replies)
Discussion started by: bluetxxth
6 Replies
5. Shell Programming and Scripting
Hi All,
I want to run a bash script using perl. But they are in the different dir.
#! /usr/bin/perl -w
use strict;
my $root=`pwd`;
chomp($root);
my $cmd=".$root/testdir/ft_623.sh 3 4 5 6 7";
print $cmd;
my @line=`$cmd`;
foreach (@line){
print $_;
}
ft_623.sh (0 Replies)
Discussion started by: Damon sine
0 Replies
6. Shell Programming and Scripting
Hi guys!
So, I use GET ( Simple user agent using LWP library. ) on a remote text file that is then passed to bash and executed. However, I need to pass that bash script a single argument, and so far nothing that I have tried has worked, although I have learned quite a bit about input/output... (5 Replies)
Discussion started by: Rhije
5 Replies
7. Shell Programming and Scripting
For the following code:
awk -F":" -v OFS=":" 'NR==FNR{a=$2;next}a{$2=a}1' shadow2 shadow1 > shadow3
I get syntex error as below:
awk: NR==FNR{a=;next}a{=a}1
awk: ^ syntax error
awk: fatal: invalid subscript expression
On investigation, I noticed that when I create a bash... (4 Replies)
Discussion started by: Praveen_218
4 Replies
8. Shell Programming and Scripting
Can someone please help me with this SHELL script?
I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1.
Here is a start but I have no clue how to... (3 Replies)
Discussion started by: I-1
3 Replies
9. UNIX for Dummies Questions & Answers
I'm having problems with bash scripts. If a bash script is called with no arguments, I always get "PHIST=!" as the first argument (i.e. this is what $1 equals). Why? Where does this come from, and how can I fix it? Nothing in the bash man pages refer to this mysterious default argument. (2 Replies)
Discussion started by: sszd
2 Replies
10. Shell Programming and Scripting
Hi all,
Can you please suggest a few lines of if statement to check if a variable is an ip address purely in bash/sh?
Thanks,
Marc (3 Replies)
Discussion started by: marcpascual
3 Replies