It is possible, but makes the code difficult to read and therefore difficult to debug. As a rule of thumb place a semi-colon where a line-feed would have been mandatory.
I much prefer the indented code:
Hello there,
I wrote a shell script to modify the code for some of our clients in our client database. Before starting the data modification the program performs a few checks.
When a check is being performed, it should be shown on the screen of the user running the program, the result of... (5 Replies)
Hi,
At the moment, I have the following statements which show like this, but I want it all on one line. How can I do this?
----------------------------
echo "There are"
cat menu | wc -l
echo "characters in the text"
----------------------------
Thanks! (5 Replies)
Hello everyone,
I got this type of error when programming in bash
new.bat: 16: cannot create : Directory nonexistent
$bool
new.bat: 37: Syntax error: "then" unexpected (expecting "fi")
Does anyone know why?
Here is my code
#!bin/bash
#function helps(){... (4 Replies)
Hi everyone,
May you help me with the correct syntax of the follow bash statements please
X=10
if ]; then
echo "The value is between 1 and 5"
for ((i=1;i<=${X})); do
echo $i
done
else if ]; then
echo "The value is between 6 and 10"
for ((i=1;i<=${X})); do
... (5 Replies)
Hi All,
Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool.
Wraper script am trying is to do with above metion 2 files.
utility tool accepts :
a. userinfo file : which contains username
b. item file : which... (2 Replies)
Heyas
I'm trying to read/display a file its content and put borders around it (tui-cat / tui-cat -t(ypwriter).
The typewriter-part is a 'bonus' but still has its own flaws, but thats for later.
So in some way, i'm trying to rewrite cat using bash and other commands.
But sadly it fails on... (2 Replies)
Would these two sections of code be equivalent?
The original is the first one, followed by the new
implementation.
if ; Then
...
else
if ; Then
...
fi
fi
if ; Then
...
else if ; Then
...
fi (4 Replies)
Hello,
I'm works on Ubuntu server
My goal : I would like to read file line per line, but i want to started at the end of file.
Currently, I use instructions :
while read line;
do
COMMAND
done < /var/log/apache2/access.log
But, the first line, i don't want this. The file is long... (5 Replies)
How to run several bash commands put in bash command line without needing and requiring a script file.
Because I'm actually a windows guy and new here so for illustration is sort of :
$ bash "echo ${PATH} & echo have a nice day!"
will do output, for example:... (4 Replies)
Hello Forum,
I'm looking to expand the following command:
INACTIVE_KERNELS=$(python -mplatform | grep -qi red && rpm -qa | grep '^kernel-' |grep -vE `uname -r` | paste -sd \; || echo "Not Red Hat Server")
Currently this command will check if my server is RedHat server using the grep -qi... (6 Replies)