1
vote
1answer
52 views

Solaris 10 : command to copy text to the clipboard. (command line)

I'm searching a command to copy text to the clipboard. xclip and xsel are commands which are available on several Linux and Unix OS-es, but is unfortenuately not available on solaris 10. ...
0
votes
3answers
53 views

Stat usage in truss command?

I want to get the access time and modification time of the file in unix solaris machine. The `stats command was not found in that solaris machine. Could you please suggest which is the alternative ...
1
vote
1answer
32 views

Global variable for every script

I want to declare a variable in such way that every script can access and alter its value. I have written a script that set the value of a variable called flag on exit and I am using a crontab entry ...
4
votes
1answer
688 views

Variable scope in while-read-loop on Solaris

    Could someone please explain to me why my while loop seems to have an internal scope? I've seen multiple explanations online but they all have to do with pipes. My code has ...
0
votes
1answer
246 views

need to display hard error , transport error & soft errors above 2

iostat -En | nawk '/Hard Errors/ {line=$0;gsub(/.*Hard Errors:/,""); \ if($1>2) printf("%s\n",line); }' The output of this is c0t1d0 Soft Errors: 0 ...
0
votes
0answers
10 views

need to display Hard error,transport error &soft error above 2 for the output of iostat -En | grep Hard like this [duplicate]

I am new to this field scripting. iam a solaris engineer.shall i get the answer of this script in KSH scripting" iostat -En | nawk '/Hard Errors/ {line=$0;gsub(/.*Hard Errors:/,"");if($1>2) ...
4
votes
1answer
159 views

returncode of command in a pipline [duplicate]

The following script runs on Solaris using /bin/ksh and on Linux using /bin/sh cmd | tee -a cmd.log | tail exit $? The output of cmd is saved in a file cmd.log and the last lines are displayed on ...
1
vote
1answer
145 views

why csv is consuming more file size in my unix script?

I'm using this unix script which it is fetching records in the form of csv. I have a SQL query used for this purpose. It contains below information SET PAGESIZE 5000 SET COLSEP "," SET LINESIZE 2000 ...
1
vote
2answers
291 views

perl one liner + how to match IP address that located in the first/sec field of file

the following perl one liner syntax verify if IP address in "$IP" match the IP ADDRESS in file perl -ne 'BEGIN{$IP=shift} print if /(^|\s)\Q$IP\E(\s|$)/;' $IP file file have two fields as the ...
2
votes
1answer
105 views

issue with how newly made gnome launchers work vs launchers rebuilt after a system boot. (title change for clarity)

This isnt so much a request for help as a curiosity of mine. I wrote this script to quickly pop up four terminal sessions and fill my screen, since so many of my current systems have things that come ...
1
vote
4answers
479 views

Solaris: Script for finding the physical device path of all installed fiber cards

I have a number of systems (with quite varying type, generation and architecture unfortunately). I need to create a list of fiber cards on these varying systems. I am able to use prtconf -v, and ...
8
votes
0answers
209 views

how to get exit status from the command before the last [duplicate]

I have solaris machine ( solaris 10 ) please Look on the following simple commands (haconf -makerw | grep -iq "Cluster already writable") # haconf -makerw VCS WARNING V-16-1-10364 Cluster ...
2
votes
1answer
240 views

perl + combine exec command with perl one liner line

I have the following short perl script rename.pl. How can I translate this script to one liner perl syntax? And how to combine the perl one liner in find command? rename.pl #!/usr/bin/perl $op = ...
2
votes
3answers
891 views

What's the best way to backup files via network on Linux and Solaris machines?

I wonder what the best way to backup files VIA network I have Solaris machines with Oracle 10i with VERITAS cluster, machines are connected to EMC storage /data/oracle directory is mounted on the ...
0
votes
1answer
236 views

Solaris 10, Shell Script, Cursor movement [closed]

#include <signal.h> #include <unistd.h> #include <stdio.h> #include <sys/types.h> #include <time.h> void prtime() { time_t rawtime; struct tm * ...
1
vote
2answers
97 views

how obtain directory files info

I have the need to get information about a specific directory, basically I need to know the correlation between small, medium and big files. I came up with this: for i in K M G; do printf $i du ...
2
votes
1answer
2k views

Bash vs ksh pipes

I am stuck with some problems with my scripts in ksh. FWIW the problem which I am unable to overcome is that when I use a structure such as this command | while read VAR1 do many.commands using ...
0
votes
2answers
159 views

file command + how to view all results from file command

I use the file command in order to verify if file (PATH) is text/ascii file or encrypted file Because file command have allot of results ( small example in example 1 ) I want to get the all ...
0
votes
1answer
144 views

linux/solaris + manipulation of Standard Output

I run the following line on linux/solaris machine ( all output will write in to /tmp/Log from application.bin ) ./application.bin 1>>/tmp/Log We can see the content of the /tmp/Log file ...
2
votes
1answer
425 views

Can i update my commands( like awk,sed) to the latest release in solaris?

bash-3.00# awk '{print NR}' f1.txt 1 2 3 4 but FNR does not print anything. awk '{print FNR}' f1.txt the above line does not gives me any output,seems that the awk that i am having in my ...
1
vote
1answer
230 views

Linux + Solaris how to verify the last execute process from list of process

I need advice: How to verify which is the last scan_sys.sh process that run in my linux or solaris ? my target is to kill all scan_sys.sh process , except the latest scan_sys.sh ( the last execute ...
0
votes
2answers
421 views

Is a shell script is a programming Language [closed]

This is the first question in UNIX: I was started shell script from 2 days before. But I have a conflict: is a shell script a special programming language for a specific shell??
2
votes
3answers
5k views

solaris 10 + display 2 lines after match by grep?

I want to match for example: The string e1000g0 from the lltconfig -a list , and then to display the two lines after the string e1000g0 so I get only the lines: Node 0 du1a : ...
11
votes
4answers
4k views

Executing user defined function in a find -exec call

I'm on Solaris 10 and I have tested the following with ksh (88), bash (3.00) and zsh (4.2.1). The following code doesn't yield any result: function foo { echo "Hello World" } find somedir -exec ...
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 ...
2
votes
4answers
661 views

Is there any handy command line tool to manage Cron jobs?

Would someone suggest any handy command line (NOT web) tool or script which adds, enables and disables Cron jobs? I am looking, for example, for the following (or similar) behavior: sh manageCron.sh ...
5
votes
2answers
2k views

Arg list too long error while using find

I have the find command as follows: find /jobs/logs/* -prune -name '*.log' -type f -mtime +1 | while read LOGFILE do echo $LOGFILE done This is failing due to the following ...