10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Repeat this text in a file named notes.txt and run the script
Before bash is a good language a blank line appears
Also, the following notes are displayed incorrectly
What is bad?
==================================
Title : Note 1
==================================
Category: Computer
Date... (3 Replies)
Discussion started by: cesar60
3 Replies
2. Shell Programming and Scripting
I'm trying to understand why a script behaves different when run through a pipe.
My OS:
Linux myip 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
This script (myscript.sh):
#!/bin/bash
echo whoami:
whoami
echo who:
who
echo who... (2 Replies)
Discussion started by: SkySmart
2 Replies
3. Shell Programming and Scripting
I copied the script from an AskUbuntu post -
#!/bin/bash
### BEGIN INIT INFO
# Provides: tomcat7
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop Tomcat server
### END INIT INFO
... (14 Replies)
Discussion started by: Hijanoqu
14 Replies
4. Shell Programming and Scripting
Hi,
I am new to shell/bash script. I am trying to run below script
#!/bin/bash
a=0
b=10
if
then
echo "a is equal to be"
else
echo "a is not equal to be"
fi
MAX=10
while
do
echo $a
a='expr $a + 1'
done (1 Reply)
Discussion started by: Mallikgm
1 Replies
5. Shell Programming and Scripting
Hi guys,
I am very new to linux, so please bear with me. https://www.unix.com/./images/smilies/smile.png
I need a simple script (bash / .sh) to start 2 programs at server startup. Both programs should run in a detached screen of their own.
So basically:
1) start a detached screen with... (2 Replies)
Discussion started by: lastcrafters
2 Replies
6. Shell Programming and Scripting
All,
Here is what I am trying to accomplish:
1. Check for a file of specific name recursively and when I find it,
a. if the file is more than 1hr old, no need to email or send notification, so just exit out from the shell script
b. if the file is less than 1hr old, send an email to me saying... (3 Replies)
Discussion started by: pnara2
3 Replies
7. Shell Programming and Scripting
Hi there,
following code snippet should output nothing, IMHO. But the result is "THE END".
#!/bin/bash
if true ; thenexit
fi | grep "somesearchstring"
echo "THE END"using bash 4.1.9(1)
Bug or feature?
Hagen (5 Replies)
Discussion started by: montour
5 Replies
8. Shell Programming and Scripting
Hi all,
Am trying to convert a script from ksh to bash :wall:. One of the sub is something like below:
#!/bin/bash
declare -a array01
step_01_test()
{
local count=0
ps -ef | grep watch | grep -v grep | awk '{ print $8 }' | while read line
do
let count=${count}+1
... (1 Reply)
Discussion started by: newbie_01
1 Replies
9. Shell Programming and Scripting
Hello,
I am not sure, where I am missing in the scirpt, I am trying to grep few users from /etc/passwd file and if exists, I added line to echo as user exist, if not create it.
#!/bin/bash
for vid in v707 z307 z496 z163 z292 ; do
if
then
echo " $vid User exists "
else
... (2 Replies)
Discussion started by: bobby320
2 Replies
10. Shell Programming and Scripting
i have two lines in my rc.local file that are
wget -O/<path>/<file>.zip url://domain.com
unzip -o /<path>/<file>.zip
the wget works fine, but the unzip won't work. when i copy/pase the unzip line to the prompt it works fine. i thought that maybe the unzip was running before the wget... (0 Replies)
Discussion started by: easysnowboards
0 Replies