0
votes
1answer
282 views

long format of ps command in Solaris

Jobs with a long command-line is not printing in Solaris: bash-3.2$ /usr/ucb/ps auxwww | grep ftf | awk '{print $NF}' | head -5 /proj/cmp01/app/btws/cfg/btw /proj/cmp01/app/btws/cfg/btw ...
1
vote
3answers
1k views

A command which returns either a process ID, if running, or some other output if not?

I'm looking for a command that will give me the PID, and it's not running it should give me some output other than blank. In my program, sometimes the library I'm using gives blank output even if ...
3
votes
3answers
5k views

change shell in Solaris/SunOS for your user only wihtout access to /etc/passwd

How do I set the shell in Solaris/SunOS for my user only, without access to /etc/passwd or any other su stuff? It should thereafter work both for interactive ssh (1) and ssh when you send commands ...
2
votes
4answers
2k views

sh and grep numbers only

I'm facing a problem and trying to find a solution that works in sh. If I could use bash this code would work: ls /a|grep ^[0-9] Unfortunately this is not the case with sh, and yes I need to use ...
3
votes
1answer
546 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
2k 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
266 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
225 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.
6
votes
3answers
1k 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
237 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 ...
4
votes
2answers
1k 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
3k 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
617 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
5answers
2k 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
94 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
387 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
4k 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
1k 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 ...
16
votes
9answers
9k 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 ...