10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have 4 parameters passed to my shell and i validate if all four are entered using the following snippet:
if
then echo "Not entered"
else echo "entered"
fi
I get the following output as 'Not entered even when i enter the values for all prompts.
Please advise.
Thanks. (5 Replies)
Discussion started by: Jesshelle David
5 Replies
2. Shell Programming and Scripting
Hi All
Need Help
I have a file with the below format (ABC.TXT) :
®¿¿ABCDHEJJSJJ|XCBJSKK01|M|7348974982790
HDFLJDKJSKJ|KJALKSD02|M|7378439274898
KJHSAJKHHJJ|LJDSAJKK03|F|9898982039999
(cont......)
I need to write a script where it will check for : blank lines (between rows,before... (6 Replies)
Discussion started by: chatwithsaurav
6 Replies
3. Shell Programming and Scripting
while i've used arrays to work with variables, i've never used them to loop through a set of strings and wanted to ask the community for some feedback or assistance.
let me be specific. here's my code:
# URL port Variables
port2195=`nc -z $url2195 2195`
port2196=`nc -z $url2196 2196`... (5 Replies)
Discussion started by: hungryd
5 Replies
4. Shell Programming and Scripting
Hi,
Will following set up work in bash script? I've got errors if assigning following binary command to a variable. But on the other hand, COMMAND="ls" works. Any explanation please? How can I assign binary command to a variable COMMAND then I can just call ${COMMAND}?
COMMAND="rsync"... (3 Replies)
Discussion started by: hce
3 Replies
5. Shell Programming and Scripting
Hi!
Been working on a script and I've been having a problem. I've finally narrowed it down to this variable I'm setting:
servername=$(awk -v FS=\/ '{ print $7 } blah.txt | sed 's\/./-/g' | awk -v FS=\- '{print $1}')"
This will essentially pare down a line like this:
... (7 Replies)
Discussion started by: creativedynamo
7 Replies
6. Shell Programming and Scripting
Apologies for the utter triviality of this question, but we all have to start somewhere! I've also tried searching but this question is pretty vague so I didn't (a) really know what to search for or (b) get many relevant hits to what I did search for.
Anyway, I'm in the process of self-teaching... (1 Reply)
Discussion started by: u5j84
1 Replies
7. Shell Programming and Scripting
Hello everyone, I'm trying the best way to implement a check on a variable ... in particular I need to assess the content of characters and numbers , I tried on various manuals bash scripting but I could not figure out how to do ... any help? (3 Replies)
Discussion started by: ionral
3 Replies
8. Shell Programming and Scripting
HI ,
I have to check the values of variable is blank or not.
exm :
###test
test1
var=`cate filename | head -1 | cut -c1-3`
I need to check the first three character of 1st line . if it is blank .then exit or we need to process .
Thanks in advance . (2 Replies)
Discussion started by: julirani
2 Replies
9. Shell Programming and Scripting
I need to check if $1 or $2 are empty before continuing but I don't know if bash has any logic of the sort. This is what I'm looking for - except that "and" doesn't seem to work.
if and ;then
...
Thank you! :D (4 Replies)
Discussion started by: ph0enix
4 Replies
10. Shell Programming and Scripting
I want to check to see if a variable is set - and if not set it to something
ie. variable name test
I want to check if $test is set
then if there is nothing set against this currently - then set it to 0
Whats the best / shortest way of doing this in a script? (3 Replies)
Discussion started by: frustrated1
3 Replies