DLeX: AI Python
21.3K subscribers
5.26K photos
1.27K videos
771 files
4.76K links
هوش‌مصنوعی و برنامه‌نویسی

توییتر :

https://twitter.com/NaviDDariya

لینک پیام ناشناس، جهت انتقادات، حرف و حدیث و پیشنهادات : https://xn--r1a.website/mahtabak_nashenas_bot?start=1dOIcE18ITmb5Htw1M7zgq
Download Telegram
#!/bin/bash

# example of using arguments to a script
echo "My first name is $1"
echo "My surname is $2"
echo "Total number of arguments is $#"

#ShellScript #Example
🆔 @ai_python
#!/bin/bash
# Counting the number of lines in a list of files
# for loop over arguments

if [ $# -lt 1 ]
then
echo "Usage: $0 file ..."
exit 1
fi

echo "$0 counts the lines of code"
l=0
n=0
s=0
for f in $*
do
l=`wc -l $f | sed 's/^\([0-9]*\).*$/\1/'`
echo "$f: $l"
n=$[ $n + 1 ]
s=$[ $s + $l ]
done

echo "$n files in total, with $s lines in total"

#ShellScript #Example #Linux
🆔 @ai_python