Tagged Questions
4
votes
1answer
59 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
67 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
...
2
votes
3answers
334 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 ...
1
vote
2answers
81 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
73 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
115 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
201 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 ...
1
vote
2answers
89 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
115 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 = ...
0
votes
1answer
147 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 * ...
2
votes
1answer
735 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 ...
7
votes
4answers
1k 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 ...
0
votes
2answers
108 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
95 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
246 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
145 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
216 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
2k 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 : ...
3
votes
2answers
579 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
403 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 ...
3
votes
2answers
1k 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 ...