10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
#!/bin/bash
shuffle()
{
Deck=$(shuf -e {2,3,4,5,6,7,8,9,T,J,Q,K,A}{H,S,D,C})
}
PH=(6H 9S KC) # playerhand
CH=(JD 4D) # computerhand
AC=2S # activecard
shuffle
echo $Deck
I am unsure about how to proceed. I want to reshuffle a deck but without the cards in... (3 Replies)
Discussion started by: cogiz
3 Replies
2. Shell Programming and Scripting
Hello.
Using a bash script , I have a variable name for the file I want to modify
FILE_TO_EDIT="/etc/my_config_file"And I have a variable name for the parameter to change
PARAMETER="fallback_node"
PARAMETER_NEW_VALUE="http://my_server_name.com/new_path"
A config file may contain :
1°)... (2 Replies)
Discussion started by: jcdole
2 Replies
3. Shell Programming and Scripting
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
Discussion started by: vivek d r
3 Replies
4. UNIX for Dummies Questions & Answers
hi all,
I am having trouble finding the right string for this - I dont know whether to use awk or sed..
If I have a file with alot of names and phone numbers like this
McGowan,Sean 978-934-4000
Kilcoyne,Kathleen 603-555-1212
Club603,The 617-505-1332
Boyle,William 301-444-1221
And... (11 Replies)
Discussion started by: alis
11 Replies
5. Shell Programming and Scripting
Greetings everyone. Right now I am working on a script to be used during automated deployment of servers. What I have to do is remove localhost.localdomain and localhost6.localdomain6 from the /etc/hosts file. Simple, right? Except most of the examples I've found using sed want to delete the entire... (4 Replies)
Discussion started by: msarro
4 Replies
6. Shell Programming and Scripting
Hi gurus,
I'd like to change this complete line on a file:
BAN_COMMAND="/etc/apf/apf -d $ATTACK_HOST {bfd.$MOD}"
to this one:
BAN_COMMAND="/sbin/iptables -A INPUT -s $ATTACK_HOST -j DROP"
I've tried a lot without any successful . :(
thanks in advance
Israel. (2 Replies)
Discussion started by: iga3725
2 Replies
7. Shell Programming and Scripting
Okay, title is kind of confusion, but basically, I have a lot of scripts on a server that I need to replace a ps command, however, the new ps command I'm trying to replace the current one with pipes to sed at one point. So now I am attempting to create another script that replaces that line.
... (1 Reply)
Discussion started by: cbo0485
1 Replies
8. Shell Programming and Scripting
Hello
I have a document and in this document I have several occurrence of "VAR == xxxxxxx" and xxxxx can be anything. I don't know what it is. I want to replace the 'xxxxx's with something I know.
What I know however, is the line numbers of the VAR =='s in the file.
How can I replace... (1 Reply)
Discussion started by: alirezan
1 Replies
9. Shell Programming and Scripting
I been trying to get this right. I have trying to get rid of spaces in between the character < and the character >. Everytime I try, sed gets too greedy and do the whole line.
Ex.
< T AG 1> Hello, how are you doing?
<Tag 2> I am doing fine.
I want this:
<TAG1> Hello, how are you... (6 Replies)
Discussion started by: quixoticking11
6 Replies
10. UNIX for Advanced & Expert Users
How Could I get the CPU Part Number from the Solaris command prompt? (Solaris 8 E4500 Server)
Thanks in advance. Hugo (2 Replies)
Discussion started by: hugo_perez
2 Replies