Tagged Questions
3
votes
1answer
182 views
Why does sendmail work differently in different shells?
The following code works when I directly run it in bash shell:
SUBJECT="SUBJECT-"`date`;
MAIL_FROM="abc@site.com";
MAIL_TO="abc@site.com";
MAIL_CC="abc@site.com";
MAIL_FILE="/path/of/html/body.html";
...
5
votes
2answers
182 views
bourne shell if [ -e $directory/file.$suffix ]
I've been looking inclusive I even checked the if manual for bash and tried in cli mode.
#!/bin/sh
CONFIG_DIR="/var/opt/SUNWldm/"
read option
if [ $option -eq 9 ]; then
ret=1
elif [ -e ...
3
votes
1answer
168 views
Use all system memory in Solaris
I am doing server testing and intentionally trying to crash a virtual Solaris server by using all memory. Server has a ulimit of 15 GB (several hundred GB of total system/swap memory). Is there a ...
-1
votes
1answer
171 views
How to add a string of numbers to multiple text files in a directory?
file.txt
file2.txt
file3.txt
I want to add 99999 to the begining of the all the file names without changing anything else in the file name in solaris 10.
4
votes
3answers
356 views
Equivalent of date --reference in Solaris
The GNU implementation of the date command has a nice feature to show the date of the last modification of a reference file, and using the +FORMAT parameter it is easy to get the date in any format, ...
2
votes
1answer
105 views
Why does newgrp change my PS1 and how to prevent it?
I have a customized PS1 to show several parameters. When I switch to a different group using newgrp, it switched my PS1 to default ($) and that is annoying. The default remains even when I switch ...
3
votes
2answers
367 views
bash myscript.sh runs in bash, but the first line is #!/usr/bin/sh
I have a script similar following one:
#!/usr/bin/sh
var="ABC"
if [ $var == "ABC" ]
then
echo True
else
echo False
fi
Above code does not work in Solaris Sparc and Solaris X64. It is showing ...
3
votes
6answers
977 views
Difference between “echo $SHELL” and “which bash”
I am trying to determine the location of bash interpreter on my Solaris system and I am a bit confused. When I type:
echo $SHELL
The resulting path is:
/bin/bash
And when I type:
which bash
I ...
2
votes
1answer
218 views
Time validation with regex
I'd like to make validation about time stamp of one of my log file. But it seems I have problem on my expression in case statement.
TIME value might be something like 11:49 or 2011. And I just want ...
3
votes
4answers
514 views
Formatting the output: Underlining
I wrote the following function in ksh that prints its first argument to the screen and underlines it with the appropriate ammount of - character:
print_underlined () {
word=$1
echo $word
...
2
votes
1answer
63 views
Solaris “clean” group files (or for that matter any text file)
I am looking to find a way to script a cleaning operation on the /etc/group file on a large number of servers. Looking for users in a particular group more than once.
i.e.
somegroup::100000:userA, ...
1
vote
4answers
327 views
FreeBSD is not Unix. But its Unix-Like Unix. Where is then the main Unix to read the source code?
I want to really understand System V, the main origin of Unix (not Unix-like nor modified Unix to Linux). The main origin which is very confusing and not really with care its written somewhere.
Is it ...
2
votes
2answers
2k views
How to exclude a list of full directory paths in find command on Solaris
(Duplicated from Stack Overflow: http://stackoverflow.com/questions/7854975/how-to-exclude-a-list-of-full-directory-paths-in-find-command-on-solaris)
I have a very specific need to find unowned files ...
2
votes
4answers
546 views
Shell scripts Linux -> Solaris conversion guide
I've developed a few Bash scripts on a LFS system which should now be made to work on a minimal installation of Sun Solaris 10. Is there a guide somewhere with at least some general tips for ...
2
votes
2answers
2k views
Shell Script Certification
I'm a UNIX shell script programmer, and I would like to know if there is any certification specific for Shell (bash, korn,etc) programmers.
Also how about CX-310-105 exam to take Oracle Solaris ...
13
votes
9answers
6k views
Tool in UNIX to subtract dates
Is there any tool in Solaris UNIX (so no GNU tool available) to subtract dates? I know that in Linux we have gawk that can subtract one date from another. But in Solaris the maximum we have is nawk ...
