|
First
|
Prev |
Next
|
Last
Pages: 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
Bourne Shell: scope of variables in while loop For some reason, I am not able to access variables that were changed in a while loop, after the while loop finishes. For example: i=0 echo "this is a test" | while read line do i = `expr $i + 1` done echo $i ------------------------------- The echo statement prints 0 rather than 1. Does anyone know w... 27 Aug 2006 15:06
Sed Find and Replace Multiple Files I'm trying to do search/replace on multiple text files. I'm using the following script: #!/bin/sh USAGE=`basename $0` USAGE=$USAGE' <PATTERN> <SUBSTITUTE> <FILES PATH>' if test $# -lt 3 then echo "-I-: $USAGE" exit 1 fi PATTERN=$1 shift SUBSTITUTION=$1 shift for i; do mv $i $i.old; sed -e 's... 25 Aug 2006 01:54
scp in non-interactive sessions problem? Hi all im new to the list, Im having a problem when using scp from within an other application and therefore in non-interactive mode. I continue getting: Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-with-mic,password). I can connect fine in in... 25 Aug 2006 04:31
Setting a variable via STDIN Hey all, I have a script (using ksh88) that takes in STDIN and stores it within a variable. Is it more apropriate to use 'cat' to do this ala: FOO=$(cat) or is it acceptabe (prefered) to do it this way: FOO=$(</dev/fd/0) This is how I am doing it now but am I setting my self up for trouble in the fu... 22 Aug 2006 12:31
Find and pattern matching on directory names Dear all, Is it possible to use find to pattern match on directory names, and then do something to all of the files that lie within the directories that are found? What I want to do is find all directories called "logs" or "data" in a heirarchy, then delete every file older than 7 days in "logs" and every f... 15 Aug 2006 09:54
How to efficiently change gid and uid? Hi all, I have a Unix box: a group called "testgrp", gid=321 dozens of users belonging to this group, e.g. tuser01 (uid=241), tuser02 (uid=257), ... not sequential... Now I have to rearrange gid and uids to keep them consistent with other systems, i.e. testgrp's gid will be changed to 7000, tuser01's uid=7001... 15 Aug 2006 08:18
sed question I am trying to locate identifiers in files and i am having trouble adjusting with sed and regular expressions for example [anacad1] syntrain:/home/syntrain/scripts$ cat htest int x87; float 7h; int kljsd; hu87; 908; int 78465;[anacad1] syntrain:/home/syntrain/scripts$ sed -n '/[a-zA-Z]+/p' htest [a... 14 Aug 2006 13:44
convert .doc to ascii Hi everyone, Is it possible to convert MS Word .doc files to ascii plain text files using something basic tools available in a standard linux distro. Basically i want to be able to let people do this using a webpage, and my ISP does not have catdoc installed. Thanks Dave. ... 3 Aug 2006 13:36
Redirection inside shell script? I have a simple C program that does SCANF on a file that contains numbers, then prints it out. Here is how I run it: a.out < matrix.txt If I put that command in a script, it works fine, but if this is my script, it doesn't get the redirection: #!/bin/sh OPTION="< matrix.txt" a.out ${OPTION} So stdin just s... 1 Aug 2006 14:09
"setenv EDITOR vi" don't work Hi. I have a user created in the system (AIX) which has the c-shell as the default shell. I defined in the .login file of the user "setenv EDITOR vi" so I can use the vi editor in the command line, but it doesn't work. I've looked in the net and everyone says I only need that line to put it working. Does a... 28 Jul 2006 07:45 |