8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am working on a script that will parse the /proc/meminfo file and return values. I have been able to pull the MemTotal and MemFree from that file but have stumbled on the next thing I want to do - calculate memory used via subtracting MemFree from MemTotal.
Would I do something like -
... (5 Replies)
Discussion started by: flyboynm
5 Replies
2. Shell Programming and Scripting
practicing perl now and hope to get uniq item from an array:
my current work:
#!/usr/local/bin/perl
my @source = ("aaa", "aaa", "bbb", "ccc", "ddd");
my $index=0;
my @uniq;
foreach (@source)
{
chomp;
# push first item to @uniq
if ($index == 0)
{
push @uniq, $_;
... (2 Replies)
Discussion started by: tiger2000
2 Replies
3. Shell Programming and Scripting
Dear all,
I have encountered some problem here. I prompt the user for input and store it into a data file, eg. key in name and marks so the data file will look like this
andrew 80
ben 75
and the next input is carine 90. So the problem here is i want to print... (2 Replies)
Discussion started by: branred
2 Replies
4. Solaris
hi,
how can I add a new value to crontab file using a script not using the command " crontab -e " .
ex:
echo " 10 10 * * * " >> /var/spoll/cron/crontabs/<username>
how can I do that in a correct way??
thanks, (3 Replies)
Discussion started by: Ahmed waheed
3 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I have the following basic script which is remove the fielld. How can I replace another value in the field? Thx!!
for file in `cat $listn.txt`
do
get_file -q $file
grep -v '<customer-id>13000</customer-id>' $file > $file.grep
done
echo All processed file done!!
input file:... (2 Replies)
Discussion started by: happyv
2 Replies
6. Shell Programming and Scripting
Dear all,
I'm have a sorted array like this:
177
220
1001
2000
2001
2003
2005
notice that 2002 and 2004 are NOT in array.
Then user input a number INPUT, our script should return OUTPUT value like this:
if INPUT is not in array => OUTPUT=INPUT
if INPUT is in array => OUTPUT is the... (4 Replies)
Discussion started by: fongthai
4 Replies
7. Shell Programming and Scripting
Hi all,
I have a file with over 10,000 line, but I would like to update/add some code number (such as 062 below) into the line with <phone number> below:
11111<name> john matin <name>
12345<phone number> 123456 <phone number>
34556 <address> 1234 lucky road <address>
11111<name> john... (7 Replies)
Discussion started by: happyv
7 Replies
8. Shell Programming and Scripting
Hello!
I am able to add an item to the dock with this command:
defaults write com.apple.dock persistent-apps -array-add... (1 Reply)
Discussion started by: emperorfabulous
1 Replies