awk --->>> /usr/xpg4/bin/awk
Hi NG, I am writing a script that is supposed to run on different UNIX- derivates. It runs OK on AIX, HP-UX and Linux. At the moment, I am implementing the SunOS part. At SunOS I came over a problem, where I need your help. The script consists of a seperate section for each UNIX-derivate and a common part, ... 26 May 2010 15:48
sed trouble with exact pattern match
Hello, I have a list of trial names like so: $ list="test1 test2 test test3 test4" I need to delete a word from a string once a trial is completed for further work. Say, say I need to delete the word 'test', I get: $ echo $list | sed s/test1//g 1 2 3 4 Which is not what I expected. I have enclosed the patt... 27 May 2010 04:53
How to remove the first 5 characters from a string?
For example, the string is: myStr1122334455. Remove "myStr" and the string becomes: 1122334455. Thanks. ... 26 May 2010 06:58
\w|while read line
\w|while read line do echo "Line is $Line" done above snippet of script does work very well but it doesn't show complete lines/arguments of w command's output. like normally I get smith pts/25 10.10.1.3 11:16 4:33 0.05s 0.04s ssh -l teether busybox and with above script I get only: smit... 26 May 2010 03:44
I have a main subdirectory and a bunch of subdirectories. I wanted to copy files from all the subdirectories that start with 2009* as the file name to another location. I wanted to also create the directories in the destination location. Example: Source MainDirectory directory1 (has 2009* and 2010* file... 29 May 2010 10:16
ANSI terminal escape sequence regexp
I am looking for a regexp that matches the ANSI terminal escape sequences (ESC [ ...) (for xterm), or alternatively for a tool (Linux) that replaces ANSI terminal sequences by an arbitrary chosen fixed replacement. Thanks. Janis ... 26 May 2010 18:03
I'm using shell script which help me to keep a copy of my mailbox for last N days (e.g. 40 days), so I need unique total file which will contain msg about last 40 days. I'm going to schedule a crontab task which will start every day at the same time. How can I create script file, where every time script starts ... 25 May 2010 05:51
How to get the oldest timestamps?
I have a file containing timestamps from the date command, for example: Thu May 13 13:51:36 PDT 2010 Wed May 12 11:51:36 PDT 2010 Mon Fed 10 10:08:20 PDT 2009 How to get the oldest timestamp? If I use a different "date" command, will it be easier to get the oldest timestamp? Thanks. ... 29 May 2010 10:16
Extracting .tgz file while preserving the .tgz file
Dear All, I usually extract a .tgz file using the following tar command. tar -zxvf foo.tgz However, this would delete foo.tgz file. Is there a way to preserve the foo.tgz file? I tried -Pzxvf and it seemed to work, but -P is for the following (from man tar) -P, --absolute-names do... 24 May 2010 09:02
What am I missing here?
I'm trying to get this case statement to check to make sure the user's input starts with wks, if not give them an error. Question is, why doesn't the ["!^wks"]* test bounce input that starts with the letters; w, k or s? Any help would be appreciated. L read WKS?"Type the workstation name to modify or press x... 26 May 2010 12:27