10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I wrote this code, questions follow
#! /bin/bash -f
# Purpose - to show how if syntax is used within an awk
clear;
ls -l;
echo "This will print out the first two columns of the inputted file in this directory";
echo "Enter filename found in this directory";
read input;
... (11 Replies)
Discussion started by: Seth
11 Replies
2. Shell Programming and Scripting
Hello folks!
While "sedding" about again, I ran into this little conundrum du jour:#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
@ARGV = ('./afile.dat', './*.txt');
$^I = '';
while (<>)
{
s/Twinkies/Dinner/g;
print;
}When run, perl complains,...but, of... (2 Replies)
Discussion started by: LinQ
2 Replies
3. Shell Programming and Scripting
Hello folks!
While "sedding" about again, I ran into this little conundrum du jour:#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
@ARGV = ('./afile.dat', './*.txt');
$^I = '';
while (<>)
{
s/Twinkies/Dinner/g;
print;
}When run, perl complains,...but, of... (1 Reply)
Discussion started by: LinQ
1 Replies
4. Shell Programming and Scripting
Trying to execute commands for different Unix user with that user's environment variable context without fully switching as that user using sudo && su capabilities.
Hoping this would help with security and not having to waste time switching between 10 different app users on same server.
I do... (6 Replies)
Discussion started by: kchinnam
6 Replies
5. Shell Programming and Scripting
Hi,
Is the below possible (SHELL = tcsh)?
-- I want to write an 'alias' something like this -
alias set_my_work "setenv SOME_VAR;tcsh -i;source work_script.cshrc"
The intention is to run this alias and enter a child shell, at the same time ensuring that the work_script.cshrc is source-ed.... (0 Replies)
Discussion started by: mishra.a.c
0 Replies
6. Solaris
Hi All,
I have rootdg encapsulated within Veritas Volume Manager.
/# vxprint -vg rootdg
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
v rootvol root ENABLED 24585216 - ACTIVE - -
v swapvol swap ENABLED 20484288 -... (3 Replies)
Discussion started by: solaris_1977
3 Replies
7. Shell Programming and Scripting
find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g'
this is simple logic to find and replace in multiple files & folders
Hope this helps.
Thanks
Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies
8. Shell Programming and Scripting
Let's say I'm trying to match potentially multiple sets of parentheses. Is there a way in a regular expression to force a match of closing parentheses specifically in the number of the opening parentheses?
For example, if the string is "((foo bar))", I want to be able to say "match any number of... (7 Replies)
Discussion started by: cvp
7 Replies
9. Shell Programming and Scripting
Can anybody tell me the difference between 1>&2 and 2>&1? (1 Reply)
Discussion started by: navi
1 Replies
10. Shell Programming and Scripting
I'm trying to use the following command to do a batch find and replace in all commonly named files through a file hierarchy
find . -name 'file' |xargs perl -pi -e 's/find/replace/g'
which works fine except for a substitution involving parenthesis.
As a specific example I'm trying to sub... (3 Replies)
Discussion started by: Jeffish
3 Replies